/*
 * This is a part of the DWT extra library. 
 * This is a D DWT port of Scintilla, a free source code editing component.
 * Copyright (C) 2005  Shawn Liu
 * 
 * http://www.dsource.org/projects/dwt/
 * http://www.digitalmars.com/d/
 * http://www.scintilla.org/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
 /*
  *	2005-12-16
  * Interanl functions use UTF8 directly. when load file, you should convert any non-UTF8 encoding to UTF8 first,
  * then call setCodePage(SC_CP_UTF8) to set default encoding to UTF8
  */
  
 /*
  * 2005-11-04
  * Initial version : 
  * Direct function Pointer is used to promote performance.  
  */
 
module dwt.extra.scintilla;

private import dwt.dwt;
private import dwt.widgets.composite;
private import dwt.widgets.display;
private import dwt.widgets.event;
private import dwt.widgets.messagebox;
private import dwt.widgets.scrollable;
private import dwt.widgets.control;
private import dwt.widgets.shell;
private import dwt.internal.win32.os;
private import dwt.events.events;
private import dwt.events.listeners;
private import dwt.graphics.point;
private import dwt.graphics.rectangle;


/**
 * Describes a range for a search, a search pattern, and a range for the search result.
 */
struct TextToFind 
{
	int start;
	int end; 
	char* searchPattern;
	int startFound; 
	int endFound; 
		
	static TextToFind opCall(char[] searchPattern, int start, int end)
	{
		TextToFind tf;
		tf.searchPattern = std.string.toStringz(searchPattern);
		tf.start = start;
		tf.end = end;
		return tf;
	}

}

/**
 * Describes a range, a String of text, and its capacity (length).
 */
struct TextRange {
	int start;
	int end;
	char[] text;
	
	static TextRange opCall(int start, int end) {
		TextRange tr;
		tr.start = start;
		tr.end = end;
		return tr;
	}
}
/**
 * SCNotification is a struct same as Scintilla struct in C file, except two fileds added. 
 * cData/cDatas as customized data pass to the notification event handler.
 * Note : the member is a little different from Scintilla's C declaration
 */
struct SCNotification {
	// hwndFrom is really an environment specifc window handle or pointer
	// but most clients of Scintilla.h do not have this type visible.
	//WindowID hwndFrom;
	int hwndFrom;
	int idFrom;
	int code;
	
    int position;
    // SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART,
    // SCN_DWELLEND, SCN_CALLTIPCLICK,
    // SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK
    int ch;             // SCN_CHARADDED, SCN_KEY
    int modifiers;      // SCN_KEY, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK
    int modificationType; // SCN_MODIFIED
    char[] text;   		// SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
    int length;         // SCN_MODIFIED
    int linesAdded;     // SCN_MODIFIED
    int message;        // SCN_MACRORECORD
    int wParam; 	    // SCN_MACRORECORD
    int lParam;	    	// SCN_MACRORECORD
    int line;           // SCN_MODIFIED
    int foldLevelNow;   // SCN_MODIFIED
    int foldLevelPrev;  // SCN_MODIFIED
    int margin;         // SCN_MARGINCLICK
    int listType;       // SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
    int x;              // SCN_DWELLSTART, SCN_DWELLEND
    int y;              // SCN_DWELLSTART, SCN_DWELLEND

	Object	cData;	// customized data;
} 

alias SCNotification* SCNotifyEvent;

private class SCNotifyHandler{		
	private void delegate(SCNotifyEvent) scnFunc;
	private int notifyType;
	private Object cData;
	
	this(Object customData, int notifyType, void delegate(SCNotifyEvent) func)
	{
		this.cData = customData;
		this.notifyType = notifyType;
		this.scnFunc = func;
	}
}

/**
 * The Scintilla source editor control (scintilla.org) as an DWT Component. 
 * @author Shawn Liu <shawn666.liu at gmail dot com>
 */
 
// I am wondering which one is the best base class for Scitilla, Control or Scrollable ??
class Scintilla : Control {

	private import std.stream;
	private import dwt.util.util;


// the C struct, internal use only
protected struct TextRange_C {
	int start;
	int end;
	char* text;
	
	static TextRange_C opCall(TextRange* tr) {
		TextRange_C trc;
		trc.start = tr.start;
		trc.end = tr.end;
		trc.text = cast(char*)tr.text;
		return trc;
	}
}

/**
 * The C declaration of SCNotification 
 */
protected struct SCNotification_C {
	NMHDR nmhdr;
    int position;
    // SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART,
    // SCN_DWELLEND, SCN_CALLTIPCLICK,
    // SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK
    int ch;             // SCN_CHARADDED, SCN_KEY
    int modifiers;      // SCN_KEY, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK
    int modificationType; // SCN_MODIFIED
    char *text;   		// SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
    int length;         // SCN_MODIFIED
    int linesAdded;     // SCN_MODIFIED
    int message;        // SCN_MACRORECORD
    int wParam;      	// SCN_MACRORECORD
    int lParam;      	// SCN_MACRORECORD
    int line;           // SCN_MODIFIED
    int foldLevelNow;   // SCN_MODIFIED
    int foldLevelPrev;  // SCN_MODIFIED
    int margin;         // SCN_MARGINCLICK
    int listType;       // SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
    int x;              // SCN_DWELLSTART, SCN_DWELLEND
    int y;              // SCN_DWELLSTART, SCN_DWELLEND

	
	public SCNotification generateScnEvent(){
		SCNotification scn;
		scn.hwndFrom = cast(int)this.nmhdr.hwndFrom;
		scn.idFrom = this.nmhdr.idFrom;
		scn.code = this.nmhdr.code;
		scn.position = this.position;
		scn.ch = this.ch;
		scn.modifiers = this.modifiers;
		scn.modificationType = this.modificationType;
		
		if(this.text !is null){
			int len = std.string.strlen(this.text);
			scn.text = this.text[0..len];
		}
		
		scn.length = this.length;
		scn.linesAdded = this.linesAdded;
		scn.message = this.message;
		scn.wParam = this.wParam;
		scn.lParam = this.lParam;
		scn.line = this.line;
		scn.foldLevelNow = this.foldLevelNow;
		scn.foldLevelPrev = this.foldLevelPrev;
		scn.margin = this.margin;
		scn.listType = this.listType;
		scn.x = this.x;
		scn.y = this.y;
		
		return scn;
	}
} 


	// ScintillaConstants
enum {
    INVALID_POSITION = -1,
    SCI_START = 2000,
    SCI_OPTIONAL_START = 3000,
    SCI_LEXER_START = 4000,
    SCI_ADDTEXT = 2001,
    SCI_ADDSTYLEDTEXT = 2002,
    SCI_INSERTTEXT = 2003,
    SCI_CLEARALL = 2004,
    SCI_CLEARDOCUMENTSTYLE = 2005,
    SCI_GETLENGTH = 2006,
    SCI_GETCHARAT = 2007,
    SCI_GETCURRENTPOS = 2008,
    SCI_GETANCHOR = 2009,
    SCI_GETSTYLEAT = 2010,
    SCI_REDO = 2011,
    SCI_SETUNDOCOLLECTION = 2012,
    SCI_SELECTALL = 2013,
    SCI_SETSAVEPOINT = 2014,
    SCI_GETSTYLEDTEXT = 2015,
    SCI_CANREDO = 2016,
    SCI_MARKERLINEFROMHANDLE = 2017,
    SCI_MARKERDELETEHANDLE = 2018,
    SCI_GETUNDOCOLLECTION = 2019,
    SCWS_INVISIBLE = 0,
    SCWS_VISIBLEALWAYS = 1,
    SCWS_VISIBLEAFTERINDENT = 2,
    SCI_GETVIEWWS = 2020,
    SCI_SETVIEWWS = 2021,
    SCI_POSITIONFROMPOINT = 2022,
    SCI_POSITIONFROMPOINTCLOSE = 2023,
    SCI_GOTOLINE = 2024,
    SCI_GOTOPOS = 2025,
    SCI_SETANCHOR = 2026,
    SCI_GETCURLINE = 2027,
    SCI_GETENDSTYLED = 2028,
    SC_EOL_CRLF = 0,
    SC_EOL_CR = 1,
    SC_EOL_LF = 2,
    SCI_CONVERTEOLS = 2029,
    SCI_GETEOLMODE = 2030,
    SCI_SETEOLMODE = 2031,
    SCI_STARTSTYLING = 2032,
    SCI_SETSTYLING = 2033,
    SCI_GETBUFFEREDDRAW = 2034,
    SCI_SETBUFFEREDDRAW = 2035,
    SCI_SETTABWIDTH = 2036,
    SCI_GETTABWIDTH = 2121,
    SC_CP_UTF8 = 65001,
    SC_CP_DBCS = 1,
    SCI_SETCODEPAGE = 2037,
    SCI_SETUSEPALETTE = 2039,
    MARKER_MAX = 31,
    SC_MARK_CIRCLE = 0,
    SC_MARK_ROUNDRECT = 1,
    SC_MARK_ARROW = 2,
    SC_MARK_SMALLRECT = 3,
    SC_MARK_SHORTARROW = 4,
    SC_MARK_EMPTY = 5,
    SC_MARK_ARROWDOWN = 6,
    SC_MARK_MINUS = 7,
    SC_MARK_PLUS = 8,
    SC_MARK_VLINE = 9,
    SC_MARK_LCORNER = 10,
    SC_MARK_TCORNER = 11,
    SC_MARK_BOXPLUS = 12,
    SC_MARK_BOXPLUSCONNECTED = 13,
    SC_MARK_BOXMINUS = 14,
    SC_MARK_BOXMINUSCONNECTED = 15,
    SC_MARK_LCORNERCURVE = 16,
    SC_MARK_TCORNERCURVE = 17,
    SC_MARK_CIRCLEPLUS = 18,
    SC_MARK_CIRCLEPLUSCONNECTED = 19,
    SC_MARK_CIRCLEMINUS = 20,
    SC_MARK_CIRCLEMINUSCONNECTED = 21,
    SC_MARK_BACKGROUND = 22,
    SC_MARK_DOTDOTDOT = 23,
    SC_MARK_ARROWS = 24,
    SC_MARK_PIXMAP = 25,
    SC_MARK_FULLRECT = 26,
    SC_MARK_CHARACTER = 10000,
    SC_MARKNUM_FOLDEREND = 25,
    SC_MARKNUM_FOLDEROPENMID = 26,
    SC_MARKNUM_FOLDERMIDTAIL = 27,
    SC_MARKNUM_FOLDERTAIL = 28,
    SC_MARKNUM_FOLDERSUB = 29,
    SC_MARKNUM_FOLDER = 30,
    SC_MARKNUM_FOLDEROPEN = 31,
    SC_MASK_FOLDERS = 0xFE000000,
    SCI_MARKERDEFINE = 2040,
    SCI_MARKERSETFORE = 2041,
    SCI_MARKERSETBACK = 2042,
    SCI_MARKERADD = 2043,
    SCI_MARKERDELETE = 2044,
    SCI_MARKERDELETEALL = 2045,
    SCI_MARKERGET = 2046,
    SCI_MARKERNEXT = 2047,
    SCI_MARKERPREVIOUS = 2048,
    SCI_MARKERDEFINEPIXMAP = 2049,
    SC_MARGIN_SYMBOL = 0,
    SC_MARGIN_NUMBER = 1,
    SCI_SETMARGINTYPEN = 2240,
    SCI_GETMARGINTYPEN = 2241,
    SCI_SETMARGINWIDTHN = 2242,
    SCI_GETMARGINWIDTHN = 2243,
    SCI_SETMARGINMASKN = 2244,
    SCI_GETMARGINMASKN = 2245,
    SCI_SETMARGINSENSITIVEN = 2246,
    SCI_GETMARGINSENSITIVEN = 2247,
    STYLE_DEFAULT = 32,
    STYLE_LINENUMBER = 33,
    STYLE_BRACELIGHT = 34,
    STYLE_BRACEBAD = 35,
    STYLE_CONTROLCHAR = 36,
    STYLE_INDENTGUIDE = 37,
    STYLE_LASTPREDEFINED = 39,
    STYLE_MAX = 127,
    SC_CHARSET_ANSI = 0,
    SC_CHARSET_DEFAULT = 1,
    SC_CHARSET_BALTIC = 186,
    SC_CHARSET_CHINESEBIG5 = 136,
    SC_CHARSET_EASTEUROPE = 238,
    SC_CHARSET_GB2312 = 134,
    SC_CHARSET_GREEK = 161,
    SC_CHARSET_HANGUL = 129,
    SC_CHARSET_MAC = 77,
    SC_CHARSET_OEM = 255,
    SC_CHARSET_RUSSIAN = 204,
    SC_CHARSET_CYRILLIC = 1251,
    SC_CHARSET_SHIFTJIS = 128,
    SC_CHARSET_SYMBOL = 2,
    SC_CHARSET_TURKISH = 162,
    SC_CHARSET_JOHAB = 130,
    SC_CHARSET_HEBREW = 177,
    SC_CHARSET_ARABIC = 178,
    SC_CHARSET_VIETNAMESE = 163,
    SC_CHARSET_THAI = 222,
    SC_CHARSET_8859_15 = 1000,
    SCI_STYLECLEARALL = 2050,
    SCI_STYLESETFORE = 2051,
    SCI_STYLESETBACK = 2052,
    SCI_STYLESETBOLD = 2053,
    SCI_STYLESETITALIC = 2054,
    SCI_STYLESETSIZE = 2055,
    SCI_STYLESETFONT = 2056,
    SCI_STYLESETEOLFILLED = 2057,
    SCI_STYLERESETDEFAULT = 2058,
    SCI_STYLESETUNDERLINE = 2059,
    SC_CASE_MIXED = 0,
    SC_CASE_UPPER = 1,
    SC_CASE_LOWER = 2,
    SCI_STYLESETCASE = 2060,
    SCI_STYLESETCHARACTERSET = 2066,
    SCI_STYLESETHOTSPOT = 2409,
    SCI_SETSELFORE = 2067,
    SCI_SETSELBACK = 2068,
    SCI_SETCARETFORE = 2069,
    SCI_ASSIGNCMDKEY = 2070,
    SCI_CLEARCMDKEY = 2071,
    SCI_CLEARALLCMDKEYS = 2072,
    SCI_SETSTYLINGEX = 2073,
    SCI_STYLESETVISIBLE = 2074,
    SCI_GETCARETPERIOD = 2075,
    SCI_SETCARETPERIOD = 2076,
    SCI_SETWORDCHARS = 2077,
    SCI_BEGINUNDOACTION = 2078,
    SCI_ENDUNDOACTION = 2079,
    INDIC_MAX = 7,
    INDIC_PLAIN = 0,
    INDIC_SQUIGGLE = 1,
    INDIC_TT = 2,
    INDIC_DIAGONAL = 3,
    INDIC_STRIKE = 4,
    INDIC_HIDDEN = 5,
    INDIC_BOX = 6,
    INDIC0_MASK = 0x20,
    INDIC1_MASK = 0x40,
    INDIC2_MASK = 0x80,
    INDICS_MASK = 0xE0,
    SCI_INDICSETSTYLE = 2080,
    SCI_INDICGETSTYLE = 2081,
    SCI_INDICSETFORE = 2082,
    SCI_INDICGETFORE = 2083,
    SCI_SETWHITESPACEFORE = 2084,
    SCI_SETWHITESPACEBACK = 2085,
    SCI_SETSTYLEBITS = 2090,
    SCI_GETSTYLEBITS = 2091,
    SCI_SETLINESTATE = 2092,
    SCI_GETLINESTATE = 2093,
    SCI_GETMAXLINESTATE = 2094,
    SCI_GETCARETLINEVISIBLE = 2095,
    SCI_SETCARETLINEVISIBLE = 2096,
    SCI_GETCARETLINEBACK = 2097,
    SCI_SETCARETLINEBACK = 2098,
    SCI_STYLESETCHANGEABLE = 2099,
    SCI_AUTOCSHOW = 2100,
    SCI_AUTOCCANCEL = 2101,
    SCI_AUTOCACTIVE = 2102,
    SCI_AUTOCPOSSTART = 2103,
    SCI_AUTOCCOMPLETE = 2104,
    SCI_AUTOCSTOPS = 2105,
    SCI_AUTOCSETSEPARATOR = 2106,
    SCI_AUTOCGETSEPARATOR = 2107,
    SCI_AUTOCSELECT = 2108,
    SCI_AUTOCSETCANCELATSTART = 2110,
    SCI_AUTOCGETCANCELATSTART = 2111,
    SCI_AUTOCSETFILLUPS = 2112,
    SCI_AUTOCSETCHOOSESINGLE = 2113,
    SCI_AUTOCGETCHOOSESINGLE = 2114,
    SCI_AUTOCSETIGNORECASE = 2115,
    SCI_AUTOCGETIGNORECASE = 2116,
    SCI_USERLISTSHOW = 2117,
    SCI_AUTOCSETAUTOHIDE = 2118,
    SCI_AUTOCGETAUTOHIDE = 2119,
    SCI_AUTOCSETDROPRESTOFWORD = 2270,
    SCI_AUTOCGETDROPRESTOFWORD = 2271,
    SCI_REGISTERIMAGE = 2405,
    SCI_CLEARREGISTEREDIMAGES = 2408,
    SCI_AUTOCGETTYPESEPARATOR = 2285,
    SCI_AUTOCSETTYPESEPARATOR = 2286,
    SCI_AUTOCSETMAXWIDTH = 2208,
    SCI_AUTOCGETMAXWIDTH = 2209,
    SCI_AUTOCSETMAXHEIGHT = 2210,
    SCI_AUTOCGETMAXHEIGHT = 2211,
    SCI_SETINDENT = 2122,
    SCI_GETINDENT = 2123,
    SCI_SETUSETABS = 2124,
    SCI_GETUSETABS = 2125,
    SCI_SETLINEINDENTATION = 2126,
    SCI_GETLINEINDENTATION = 2127,
    SCI_GETLINEINDENTPOSITION = 2128,
    SCI_GETCOLUMN = 2129,
    SCI_SETHSCROLLBAR = 2130,
    SCI_GETHSCROLLBAR = 2131,
    SCI_SETINDENTATIONGUIDES = 2132,
    SCI_GETINDENTATIONGUIDES = 2133,
    SCI_SETHIGHLIGHTGUIDE = 2134,
    SCI_GETHIGHLIGHTGUIDE = 2135,
    SCI_GETLINEENDPOSITION = 2136,
    SCI_GETCODEPAGE = 2137,
    SCI_GETCARETFORE = 2138,
    SCI_GETUSEPALETTE = 2139,
    SCI_GETREADONLY = 2140,
    SCI_SETCURRENTPOS = 2141,
    SCI_SETSELECTIONSTART = 2142,
    SCI_GETSELECTIONSTART = 2143,
    SCI_SETSELECTIONEND = 2144,
    SCI_GETSELECTIONEND = 2145,
    SCI_SETPRINTMAGNIFICATION = 2146,
    SCI_GETPRINTMAGNIFICATION = 2147,
    SC_PRINT_NORMAL = 0,
    SC_PRINT_INVERTLIGHT = 1,
    SC_PRINT_BLACKONWHITE = 2,
    SC_PRINT_COLOURONWHITE = 3,
    SC_PRINT_COLOURONWHITEDEFAULTBG = 4,
    SCI_SETPRINTCOLOURMODE = 2148,
    SCI_GETPRINTCOLOURMODE = 2149,
    SCFIND_WHOLEWORD = 2,
    SCFIND_MATCHCASE = 4,
    SCFIND_WORDSTART = 0x00100000,
    SCFIND_REGEXP = 0x00200000,
    SCFIND_POSIX = 0x00400000,
    SCI_FINDTEXT = 2150,
    SCI_FORMATRANGE = 2151,
    SCI_GETFIRSTVISIBLELINE = 2152,
    SCI_GETLINE = 2153,
    SCI_GETLINECOUNT = 2154,
    SCI_SETMARGINLEFT = 2155,
    SCI_GETMARGINLEFT = 2156,
    SCI_SETMARGINRIGHT = 2157,
    SCI_GETMARGINRIGHT = 2158,
    SCI_GETMODIFY = 2159,
    SCI_SETSEL = 2160,
    SCI_GETSELTEXT = 2161,
    SCI_GETTEXTRANGE = 2162,
    SCI_HIDESELECTION = 2163,
    SCI_POINTXFROMPOSITION = 2164,
    SCI_POINTYFROMPOSITION = 2165,
    SCI_LINEFROMPOSITION = 2166,
    SCI_POSITIONFROMLINE = 2167,
    SCI_LINESCROLL = 2168,
    SCI_SCROLLCARET = 2169,
    SCI_REPLACESEL = 2170,
    SCI_SETREADONLY = 2171,
    SCI_NULL = 2172,
    SCI_CANPASTE = 2173,
    SCI_CANUNDO = 2174,
    SCI_EMPTYUNDOBUFFER = 2175,
    SCI_UNDO = 2176,
    SCI_CUT = 2177,
    SCI_COPY = 2178,
    SCI_PASTE = 2179,
    SCI_CLEAR = 2180,
    SCI_SETTEXT = 2181,
    SCI_GETTEXT = 2182,
    SCI_GETTEXTLENGTH = 2183,
    SCI_GETDIRECTFUNCTION = 2184,
    SCI_GETDIRECTPOINTER = 2185,
    SCI_SETOVERTYPE = 2186,
    SCI_GETOVERTYPE = 2187,
    SCI_SETCARETWIDTH = 2188,
    SCI_GETCARETWIDTH = 2189,
    SCI_SETTARGETSTART = 2190,
    SCI_GETTARGETSTART = 2191,
    SCI_SETTARGETEND = 2192,
    SCI_GETTARGETEND = 2193,
    SCI_REPLACETARGET = 2194,
    SCI_REPLACETARGETRE = 2195,
    SCI_SEARCHINTARGET = 2197,
    SCI_SETSEARCHFLAGS = 2198,
    SCI_GETSEARCHFLAGS = 2199,
    SCI_CALLTIPSHOW = 2200,
    SCI_CALLTIPCANCEL = 2201,
    SCI_CALLTIPACTIVE = 2202,
    SCI_CALLTIPPOSSTART = 2203,
    SCI_CALLTIPSETHLT = 2204,
    SCI_CALLTIPSETBACK = 2205,
    SCI_CALLTIPSETFORE = 2206,
    SCI_CALLTIPSETFOREHLT = 2207,
    SCI_VISIBLEFROMDOCLINE = 2220,
    SCI_DOCLINEFROMVISIBLE = 2221,
    SCI_WRAPCOUNT = 2235,
    SC_FOLDLEVELBASE = 0x400,
    SC_FOLDLEVELWHITEFLAG = 0x1000,
    SC_FOLDLEVELHEADERFLAG = 0x2000,
    SC_FOLDLEVELBOXHEADERFLAG = 0x4000,
    SC_FOLDLEVELBOXFOOTERFLAG = 0x8000,
    SC_FOLDLEVELCONTRACTED = 0x10000,
    SC_FOLDLEVELUNINDENT = 0x20000,
    SC_FOLDLEVELNUMBERMASK = 0x0FFF,
    SCI_SETFOLDLEVEL = 2222,
    SCI_GETFOLDLEVEL = 2223,
    SCI_GETLASTCHILD = 2224,
    SCI_GETFOLDPARENT = 2225,
    SCI_SHOWLINES = 2226,
    SCI_HIDELINES = 2227,
    SCI_GETLINEVISIBLE = 2228,
    SCI_SETFOLDEXPANDED = 2229,
    SCI_GETFOLDEXPANDED = 2230,
    SCI_TOGGLEFOLD = 2231,
    SCI_ENSUREVISIBLE = 2232,
    SC_FOLDFLAG_LINEBEFORE_EXPANDED = 0x0002,
    SC_FOLDFLAG_LINEBEFORE_CONTRACTED = 0x0004,
    SC_FOLDFLAG_LINEAFTER_EXPANDED = 0x0008,
    SC_FOLDFLAG_LINEAFTER_CONTRACTED = 0x0010,
    SC_FOLDFLAG_LEVELNUMBERS = 0x0040,
    SC_FOLDFLAG_BOX = 0x0001,
    SCI_SETFOLDFLAGS = 2233,
    SCI_ENSUREVISIBLEENFORCEPOLICY = 2234,
    SCI_SETTABINDENTS = 2260,
    SCI_GETTABINDENTS = 2261,
    SCI_SETBACKSPACEUNINDENTS = 2262,
    SCI_GETBACKSPACEUNINDENTS = 2263,
    SC_TIME_FOREVER = 10000000,
    SCI_SETMOUSEDWELLTIME = 2264,
    SCI_GETMOUSEDWELLTIME = 2265,
    SCI_WORDSTARTPOSITION = 2266,
    SCI_WORDENDPOSITION = 2267,
    SC_WRAP_NONE = 0,
    SC_WRAP_WORD = 1,
    SC_WRAP_CHAR = 2,
    SCI_SETWRAPMODE = 2268,
    SCI_GETWRAPMODE = 2269,
    SC_WRAPVISUALFLAG_NONE = 0x0000,
    SC_WRAPVISUALFLAG_END = 0x0001,
    SC_WRAPVISUALFLAG_START = 0x0002,
    SCI_SETWRAPVISUALFLAGS = 2460,
    SCI_GETWRAPVISUALFLAGS = 2461,
    SC_WRAPVISUALFLAGLOC_DEFAULT = 0x0000,
    SC_WRAPVISUALFLAGLOC_END_BY_TEXT = 0x0001,
    SC_WRAPVISUALFLAGLOC_START_BY_TEXT = 0x0002,
    SCI_SETWRAPVISUALFLAGSLOCATION = 2462,
    SCI_GETWRAPVISUALFLAGSLOCATION = 2463,
    SCI_SETWRAPSTARTINDENT = 2464,
    SCI_GETWRAPSTARTINDENT = 2465,
    SC_CACHE_NONE = 0,
    SC_CACHE_CARET = 1,
    SC_CACHE_PAGE = 2,
    SC_CACHE_DOCUMENT = 3,
    SCI_SETLAYOUTCACHE = 2272,
    SCI_GETLAYOUTCACHE = 2273,
    SCI_SETSCROLLWIDTH = 2274,
    SCI_GETSCROLLWIDTH = 2275,
    SCI_TEXTWIDTH = 2276,
    SCI_SETENDATLASTLINE = 2277,
    SCI_GETENDATLASTLINE = 2278,
    SCI_TEXTHEIGHT = 2279,
    SCI_SETVSCROLLBAR = 2280,
    SCI_GETVSCROLLBAR = 2281,
    SCI_APPENDTEXT = 2282,
    SCI_GETTWOPHASEDRAW = 2283,
    SCI_SETTWOPHASEDRAW = 2284,
    SCI_TARGETFROMSELECTION = 2287,
    SCI_LINESJOIN = 2288,
    SCI_LINESSPLIT = 2289,
    SCI_SETFOLDMARGINCOLOUR = 2290,
    SCI_SETFOLDMARGINHICOLOUR = 2291,
    SCI_LINEDOWN = 2300,
    SCI_LINEDOWNEXTEND = 2301,
    SCI_LINEUP = 2302,
    SCI_LINEUPEXTEND = 2303,
    SCI_CHARLEFT = 2304,
    SCI_CHARLEFTEXTEND = 2305,
    SCI_CHARRIGHT = 2306,
    SCI_CHARRIGHTEXTEND = 2307,
    SCI_WORDLEFT = 2308,
    SCI_WORDLEFTEXTEND = 2309,
    SCI_WORDRIGHT = 2310,
    SCI_WORDRIGHTEXTEND = 2311,
    SCI_HOME = 2312,
    SCI_HOMEEXTEND = 2313,
    SCI_LINEEND = 2314,
    SCI_LINEENDEXTEND = 2315,
    SCI_DOCUMENTSTART = 2316,
    SCI_DOCUMENTSTARTEXTEND = 2317,
    SCI_DOCUMENTEND = 2318,
    SCI_DOCUMENTENDEXTEND = 2319,
    SCI_PAGEUP = 2320,
    SCI_PAGEUPEXTEND = 2321,
    SCI_PAGEDOWN = 2322,
    SCI_PAGEDOWNEXTEND = 2323,
    SCI_EDITTOGGLEOVERTYPE = 2324,
    SCI_CANCEL = 2325,
    SCI_DELETEBACK = 2326,
    SCI_TAB = 2327,
    SCI_BACKTAB = 2328,
    SCI_NEWLINE = 2329,
    SCI_FORMFEED = 2330,
    SCI_VCHOME = 2331,
    SCI_VCHOMEEXTEND = 2332,
    SCI_ZOOMIN = 2333,
    SCI_ZOOMOUT = 2334,
    SCI_DELWORDLEFT = 2335,
    SCI_DELWORDRIGHT = 2336,
    SCI_LINECUT = 2337,
    SCI_LINEDELETE = 2338,
    SCI_LINETRANSPOSE = 2339,
    SCI_LINEDUPLICATE = 2404,
    SCI_LOWERCASE = 2340,
    SCI_UPPERCASE = 2341,
    SCI_LINESCROLLDOWN = 2342,
    SCI_LINESCROLLUP = 2343,
    SCI_DELETEBACKNOTLINE = 2344,
    SCI_HOMEDISPLAY = 2345,
    SCI_HOMEDISPLAYEXTEND = 2346,
    SCI_LINEENDDISPLAY = 2347,
    SCI_LINEENDDISPLAYEXTEND = 2348,
    SCI_HOMEWRAP = 2349,
    SCI_HOMEWRAPEXTEND = 2450,
    SCI_LINEENDWRAP = 2451,
    SCI_LINEENDWRAPEXTEND = 2452,
    SCI_VCHOMEWRAP = 2453,
    SCI_VCHOMEWRAPEXTEND = 2454,
    SCI_LINECOPY = 2455,
    SCI_MOVECARETINSIDEVIEW = 2401,
    SCI_LINELENGTH = 2350,
    SCI_BRACEHIGHLIGHT = 2351,
    SCI_BRACEBADLIGHT = 2352,
    SCI_BRACEMATCH = 2353,
    SCI_GETVIEWEOL = 2355,
    SCI_SETVIEWEOL = 2356,
    SCI_GETDOCPOINTER = 2357,
    SCI_SETDOCPOINTER = 2358,
    SCI_SETMODEVENTMASK = 2359,
    EDGE_NONE = 0,
    EDGE_LINE = 1,
    EDGE_BACKGROUND = 2,
    SCI_GETEDGECOLUMN = 2360,
    SCI_SETEDGECOLUMN = 2361,
    SCI_GETEDGEMODE = 2362,
    SCI_SETEDGEMODE = 2363,
    SCI_GETEDGECOLOUR = 2364,
    SCI_SETEDGECOLOUR = 2365,
    SCI_SEARCHANCHOR = 2366,
    SCI_SEARCHNEXT = 2367,
    SCI_SEARCHPREV = 2368,
    SCI_LINESONSCREEN = 2370,
    SCI_USEPOPUP = 2371,
    SCI_SELECTIONISRECTANGLE = 2372,
    SCI_SETZOOM = 2373,
    SCI_GETZOOM = 2374,
    SCI_CREATEDOCUMENT = 2375,
    SCI_ADDREFDOCUMENT = 2376,
    SCI_RELEASEDOCUMENT = 2377,
    SCI_GETMODEVENTMASK = 2378,
    SCI_SETFOCUS = 2380,
    SCI_GETFOCUS = 2381,
    SCI_SETSTATUS = 2382,
    SCI_GETSTATUS = 2383,
    SCI_SETMOUSEDOWNCAPTURES = 2384,
    SCI_GETMOUSEDOWNCAPTURES = 2385,
    SC_CURSORNORMAL = -1,
    SC_CURSORWAIT = 4,
    SCI_SETCURSOR = 2386,
    SCI_GETCURSOR = 2387,
    SCI_SETCONTROLCHARSYMBOL = 2388,
    SCI_GETCONTROLCHARSYMBOL = 2389,
    SCI_WORDPARTLEFT = 2390,
    SCI_WORDPARTLEFTEXTEND = 2391,
    SCI_WORDPARTRIGHT = 2392,
    SCI_WORDPARTRIGHTEXTEND = 2393,
    VISIBLE_SLOP = 0x01,
    VISIBLE_STRICT = 0x04,
    SCI_SETVISIBLEPOLICY = 2394,
    SCI_DELLINELEFT = 2395,
    SCI_DELLINERIGHT = 2396,
    SCI_SETXOFFSET = 2397,
    SCI_GETXOFFSET = 2398,
    SCI_CHOOSECARETX = 2399,
    SCI_GRABFOCUS = 2400,
    CARET_SLOP = 0x01,
    CARET_STRICT = 0x04,
    CARET_JUMPS = 0x10,
    CARET_EVEN = 0x08,
    SCI_SETXCARETPOLICY = 2402,
    SCI_SETYCARETPOLICY = 2403,
    SCI_SETPRINTWRAPMODE = 2406,
    SCI_GETPRINTWRAPMODE = 2407,
    SCI_SETHOTSPOTACTIVEFORE = 2410,
    SCI_SETHOTSPOTACTIVEBACK = 2411,
    SCI_SETHOTSPOTACTIVEUNDERLINE = 2412,
    SCI_SETHOTSPOTSINGLELINE = 2421,
    SCI_PARADOWN = 2413,
    SCI_PARADOWNEXTEND = 2414,
    SCI_PARAUP = 2415,
    SCI_PARAUPEXTEND = 2416,
    SCI_POSITIONBEFORE = 2417,
    SCI_POSITIONAFTER = 2418,
    SCI_COPYRANGE = 2419,
    SCI_COPYTEXT = 2420,
    SC_SEL_STREAM = 0,
    SC_SEL_RECTANGLE = 1,
    SC_SEL_LINES = 2,
    SCI_SETSELECTIONMODE = 2422,
    SCI_GETSELECTIONMODE = 2423,
    SCI_GETLINESELSTARTPOSITION = 2424,
    SCI_GETLINESELENDPOSITION = 2425,
    SCI_LINEDOWNRECTEXTEND = 2426,
    SCI_LINEUPRECTEXTEND = 2427,
    SCI_CHARLEFTRECTEXTEND = 2428,
    SCI_CHARRIGHTRECTEXTEND = 2429,
    SCI_HOMERECTEXTEND = 2430,
    SCI_VCHOMERECTEXTEND = 2431,
    SCI_LINEENDRECTEXTEND = 2432,
    SCI_PAGEUPRECTEXTEND = 2433,
    SCI_PAGEDOWNRECTEXTEND = 2434,
    SCI_STUTTEREDPAGEUP = 2435,
    SCI_STUTTEREDPAGEUPEXTEND = 2436,
    SCI_STUTTEREDPAGEDOWN = 2437,
    SCI_STUTTEREDPAGEDOWNEXTEND = 2438,
    SCI_WORDLEFTEND = 2439,
    SCI_WORDLEFTENDEXTEND = 2440,
    SCI_WORDRIGHTEND = 2441,
    SCI_WORDRIGHTENDEXTEND = 2442,
    SCI_SETWHITESPACECHARS = 2443,
    SCI_SETCHARSDEFAULT = 2444,
    SCI_AUTOCGETCURRENT = 2445,
    SCI_ALLOCATE = 2446,
    SCI_TARGETASUTF8 = 2447,
    SCI_SETLENGTHFORENCODE = 2448,
    SCI_ENCODEDFROMUTF8 = 2449,
    SCI_FINDCOLUMN = 2456,
    SCI_GETCARETSTICKY = 2457,
    SCI_SETCARETSTICKY = 2458,
    SCI_TOGGLECARETSTICKY = 2459,
    SCI_STARTRECORD = 3001,
    SCI_STOPRECORD = 3002,
    SCI_SETLEXER = 4001,
    SCI_GETLEXER = 4002,
    SCI_COLOURISE = 4003,
    SCI_SETPROPERTY = 4004,
    KEYWORDSET_MAX = 8,
    SCI_SETKEYWORDS = 4005,
    SCI_SETLEXERLANGUAGE = 4006,
    SCI_LOADLEXERLIBRARY = 4007,
    SCI_GETPROPERTY = 4008,
    SCI_GETPROPERTYEXPANDED = 4009,
    SCI_GETPROPERTYINT = 4010,
    SC_MOD_INSERTTEXT = 0x1,
    SC_MOD_DELETETEXT = 0x2,
    SC_MOD_CHANGESTYLE = 0x4,
    SC_MOD_CHANGEFOLD = 0x8,
    SC_PERFORMED_USER = 0x10,
    SC_PERFORMED_UNDO = 0x20,
    SC_PERFORMED_REDO = 0x40,
    SC_MULTISTEPUNDOREDO = 0x80,
    SC_LASTSTEPINUNDOREDO = 0x100,
    SC_MOD_CHANGEMARKER = 0x200,
    SC_MOD_BEFOREINSERT = 0x400,
    SC_MOD_BEFOREDELETE = 0x800,
    SC_MULTILINEUNDOREDO = 0x1000,
    SC_MODEVENTMASKALL = 0x1FFF,
    SCEN_CHANGE = 768,
    SCEN_SETFOCUS = 512,
    SCEN_KILLFOCUS = 256,
    SCK_DOWN = 300,
    SCK_UP = 301,
    SCK_LEFT = 302,
    SCK_RIGHT = 303,
    SCK_HOME = 304,
    SCK_END = 305,
    SCK_PRIOR = 306,
    SCK_NEXT = 307,
    SCK_DELETE = 308,
    SCK_INSERT = 309,
    SCK_ESCAPE = 7,
    SCK_BACK = 8,
    SCK_TAB = 9,
    SCK_RETURN = 13,
    SCK_ADD = 310,
    SCK_SUBTRACT = 311,
    SCK_DIVIDE = 312,
    SCMOD_SHIFT = 1,
    SCMOD_CTRL = 2,
    SCMOD_ALT = 4,
    SCN_STYLENEEDED = 2000,
    SCN_CHARADDED = 2001,
    SCN_SAVEPOINTREACHED = 2002,
    SCN_SAVEPOINTLEFT = 2003,
    SCN_MODIFYATTEMPTRO = 2004,
    SCN_KEY = 2005,
    SCN_DOUBLECLICK = 2006,
    SCN_UPDATEUI = 2007,
    SCN_MODIFIED = 2008,
    SCN_MACRORECORD = 2009,
    SCN_MARGINCLICK = 2010,
    SCN_NEEDSHOWN = 2011,
    SCN_PAINTED = 2013,
    SCN_USERLISTSELECTION = 2014,
    SCN_URIDROPPED = 2015,
    SCN_DWELLSTART = 2016,
    SCN_DWELLEND = 2017,
    SCN_ZOOM = 2018,
    SCN_HOTSPOTCLICK = 2019,
    SCN_HOTSPOTDOUBLECLICK = 2020,
    SCN_CALLTIPCLICK = 2021,
    SCN_AUTOCSELECTION = 2022,
};
//--Autogenerated -- end of section automatically generated from Scintilla.iface

// SciLexer features - not in standard Scintilla
enum{
//++Autogenerated -- start of section automatically generated from Scintilla.iface
  SCLEX_CONTAINER = 0
, SCLEX_NULL = 1
, SCLEX_PYTHON = 2
, SCLEX_CPP = 3
, SCLEX_HTML = 4
, SCLEX_XML = 5
, SCLEX_PERL = 6
, SCLEX_SQL = 7
, SCLEX_VB = 8
, SCLEX_PROPERTIES = 9
, SCLEX_ERRORLIST = 10
, SCLEX_MAKEFILE = 11
, SCLEX_BATCH = 12
, SCLEX_XCODE = 13
, SCLEX_LATEX = 14
, SCLEX_LUA = 15
, SCLEX_DIFF = 16
, SCLEX_CONF = 17
, SCLEX_PASCAL = 18
, SCLEX_AVE = 19
, SCLEX_ADA = 20
, SCLEX_LISP = 21
, SCLEX_RUBY = 22
, SCLEX_EIFFEL = 23
, SCLEX_EIFFELKW = 24
, SCLEX_TCL = 25
, SCLEX_NNCRONTAB = 26
, SCLEX_BULLANT = 27
, SCLEX_VBSCRIPT = 28
, SCLEX_BAAN = 31
, SCLEX_MATLAB = 32
, SCLEX_SCRIPTOL = 33
, SCLEX_ASM = 34
, SCLEX_CPPNOCASE = 35
, SCLEX_FORTRAN = 36
, SCLEX_F77 = 37
, SCLEX_CSS = 38
, SCLEX_POV = 39
, SCLEX_LOUT = 40
, SCLEX_ESCRIPT = 41
, SCLEX_PS = 42
, SCLEX_NSIS = 43
, SCLEX_MMIXAL = 44
, SCLEX_CLW = 45
, SCLEX_CLWNOCASE = 46
, SCLEX_LOT = 47
, SCLEX_YAML = 48
, SCLEX_TEX = 49
, SCLEX_METAPOST = 50
, SCLEX_POWERBASIC = 51
, SCLEX_FORTH = 52
, SCLEX_ERLANG = 53
, SCLEX_OCTAVE = 54
, SCLEX_MSSQL = 55
, SCLEX_VERILOG = 56
, SCLEX_KIX = 57
, SCLEX_GUI4CLI = 58
, SCLEX_SPECMAN = 59
, SCLEX_AU3 = 60
, SCLEX_APDL = 61
, SCLEX_BASH = 62
, SCLEX_ASN1 = 63
, SCLEX_VHDL = 64
, SCLEX_CAML = 65
, SCLEX_BLITZBASIC = 66
, SCLEX_PUREBASIC = 67
, SCLEX_HASKELL = 68
, SCLEX_PHPSCRIPT = 69
, SCLEX_TADS3 = 70
, SCLEX_REBOL = 71
, SCLEX_SMALLTALK = 72
, SCLEX_FLAGSHIP = 73
, SCLEX_CSOUND = 74
, SCLEX_FREEBASIC = 75
, SCLEX_AUTOMATIC = 1000
, SCE_P_DEFAULT = 0
, SCE_P_COMMENTLINE = 1
, SCE_P_NUMBER = 2
, SCE_P_STRING = 3
, SCE_P_CHARACTER = 4
, SCE_P_WORD = 5
, SCE_P_TRIPLE = 6
, SCE_P_TRIPLEDOUBLE = 7
, SCE_P_CLASSNAME = 8
, SCE_P_DEFNAME = 9
, SCE_P_OPERATOR = 10
, SCE_P_IDENTIFIER = 11
, SCE_P_COMMENTBLOCK = 12
, SCE_P_STRINGEOL = 13
, SCE_C_DEFAULT = 0
, SCE_C_COMMENT = 1
, SCE_C_COMMENTLINE = 2
, SCE_C_COMMENTDOC = 3
, SCE_C_NUMBER = 4
, SCE_C_WORD = 5
, SCE_C_STRING = 6
, SCE_C_CHARACTER = 7
, SCE_C_UUID = 8
, SCE_C_PREPROCESSOR = 9
, SCE_C_OPERATOR = 10
, SCE_C_IDENTIFIER = 11
, SCE_C_STRINGEOL = 12
, SCE_C_VERBATIM = 13
, SCE_C_REGEX = 14
, SCE_C_COMMENTLINEDOC = 15
, SCE_C_WORD2 = 16
, SCE_C_COMMENTDOCKEYWORD = 17
, SCE_C_COMMENTDOCKEYWORDERROR = 18
, SCE_C_GLOBALCLASS = 19
, SCE_H_DEFAULT = 0
, SCE_H_TAG = 1
, SCE_H_TAGUNKNOWN = 2
, SCE_H_ATTRIBUTE = 3
, SCE_H_ATTRIBUTEUNKNOWN = 4
, SCE_H_NUMBER = 5
, SCE_H_DOUBLESTRING = 6
, SCE_H_SINGLESTRING = 7
, SCE_H_OTHER = 8
, SCE_H_COMMENT = 9
, SCE_H_ENTITY = 10
, SCE_H_TAGEND = 11
, SCE_H_XMLSTART = 12
, SCE_H_XMLEND = 13
, SCE_H_SCRIPT = 14
, SCE_H_ASP = 15
, SCE_H_ASPAT = 16
, SCE_H_CDATA = 17
, SCE_H_QUESTION = 18
, SCE_H_VALUE = 19
, SCE_H_XCCOMMENT = 20
, SCE_H_SGML_DEFAULT = 21
, SCE_H_SGML_COMMAND = 22
, SCE_H_SGML_1ST_PARAM = 23
, SCE_H_SGML_DOUBLESTRING = 24
, SCE_H_SGML_SIMPLESTRING = 25
, SCE_H_SGML_ERROR = 26
, SCE_H_SGML_SPECIAL = 27
, SCE_H_SGML_ENTITY = 28
, SCE_H_SGML_COMMENT = 29
, SCE_H_SGML_1ST_PARAM_COMMENT = 30
, SCE_H_SGML_BLOCK_DEFAULT = 31
, SCE_HJ_START = 40
, SCE_HJ_DEFAULT = 41
, SCE_HJ_COMMENT = 42
, SCE_HJ_COMMENTLINE = 43
, SCE_HJ_COMMENTDOC = 44
, SCE_HJ_NUMBER = 45
, SCE_HJ_WORD = 46
, SCE_HJ_KEYWORD = 47
, SCE_HJ_DOUBLESTRING = 48
, SCE_HJ_SINGLESTRING = 49
, SCE_HJ_SYMBOLS = 50
, SCE_HJ_STRINGEOL = 51
, SCE_HJ_REGEX = 52
, SCE_HJA_START = 55
, SCE_HJA_DEFAULT = 56
, SCE_HJA_COMMENT = 57
, SCE_HJA_COMMENTLINE = 58
, SCE_HJA_COMMENTDOC = 59
, SCE_HJA_NUMBER = 60
, SCE_HJA_WORD = 61
, SCE_HJA_KEYWORD = 62
, SCE_HJA_DOUBLESTRING = 63
, SCE_HJA_SINGLESTRING = 64
, SCE_HJA_SYMBOLS = 65
, SCE_HJA_STRINGEOL = 66
, SCE_HJA_REGEX = 67
, SCE_HB_START = 70
, SCE_HB_DEFAULT = 71
, SCE_HB_COMMENTLINE = 72
, SCE_HB_NUMBER = 73
, SCE_HB_WORD = 74
, SCE_HB_STRING = 75
, SCE_HB_IDENTIFIER = 76
, SCE_HB_STRINGEOL = 77
, SCE_HBA_START = 80
, SCE_HBA_DEFAULT = 81
, SCE_HBA_COMMENTLINE = 82
, SCE_HBA_NUMBER = 83
, SCE_HBA_WORD = 84
, SCE_HBA_STRING = 85
, SCE_HBA_IDENTIFIER = 86
, SCE_HBA_STRINGEOL = 87
, SCE_HP_START = 90
, SCE_HP_DEFAULT = 91
, SCE_HP_COMMENTLINE = 92
, SCE_HP_NUMBER = 93
, SCE_HP_STRING = 94
, SCE_HP_CHARACTER = 95
, SCE_HP_WORD = 96
, SCE_HP_TRIPLE = 97
, SCE_HP_TRIPLEDOUBLE = 98
, SCE_HP_CLASSNAME = 99
, SCE_HP_DEFNAME = 100
, SCE_HP_OPERATOR = 101
, SCE_HP_IDENTIFIER = 102
, SCE_HPHP_COMPLEX_VARIABLE = 104
, SCE_HPA_START = 105
, SCE_HPA_DEFAULT = 106
, SCE_HPA_COMMENTLINE = 107
, SCE_HPA_NUMBER = 108
, SCE_HPA_STRING = 109
, SCE_HPA_CHARACTER = 110
, SCE_HPA_WORD = 111
, SCE_HPA_TRIPLE = 112
, SCE_HPA_TRIPLEDOUBLE = 113
, SCE_HPA_CLASSNAME = 114
, SCE_HPA_DEFNAME = 115
, SCE_HPA_OPERATOR = 116
, SCE_HPA_IDENTIFIER = 117
, SCE_HPHP_DEFAULT = 118
, SCE_HPHP_HSTRING = 119
, SCE_HPHP_SIMPLESTRING = 120
, SCE_HPHP_WORD = 121
, SCE_HPHP_NUMBER = 122
, SCE_HPHP_VARIABLE = 123
, SCE_HPHP_COMMENT = 124
, SCE_HPHP_COMMENTLINE = 125
, SCE_HPHP_HSTRING_VARIABLE = 126
, SCE_HPHP_OPERATOR = 127
, SCE_PL_DEFAULT = 0
, SCE_PL_ERROR = 1
, SCE_PL_COMMENTLINE = 2
, SCE_PL_POD = 3
, SCE_PL_NUMBER = 4
, SCE_PL_WORD = 5
, SCE_PL_STRING = 6
, SCE_PL_CHARACTER = 7
, SCE_PL_PUNCTUATION = 8
, SCE_PL_PREPROCESSOR = 9
, SCE_PL_OPERATOR = 10
, SCE_PL_IDENTIFIER = 11
, SCE_PL_SCALAR = 12
, SCE_PL_ARRAY = 13
, SCE_PL_HASH = 14
, SCE_PL_SYMBOLTABLE = 15
, SCE_PL_VARIABLE_INDEXER = 16
, SCE_PL_REGEX = 17
, SCE_PL_REGSUBST = 18
, SCE_PL_LONGQUOTE = 19
, SCE_PL_BACKTICKS = 20
, SCE_PL_DATASECTION = 21
, SCE_PL_HERE_DELIM = 22
, SCE_PL_HERE_Q = 23
, SCE_PL_HERE_QQ = 24
, SCE_PL_HERE_QX = 25
, SCE_PL_STRING_Q = 26
, SCE_PL_STRING_QQ = 27
, SCE_PL_STRING_QX = 28
, SCE_PL_STRING_QR = 29
, SCE_PL_STRING_QW = 30
, SCE_PL_POD_VERB = 31
, SCE_RB_DEFAULT = 0
, SCE_RB_ERROR = 1
, SCE_RB_COMMENTLINE = 2
, SCE_RB_POD = 3
, SCE_RB_NUMBER = 4
, SCE_RB_WORD = 5
, SCE_RB_STRING = 6
, SCE_RB_CHARACTER = 7
, SCE_RB_CLASSNAME = 8
, SCE_RB_DEFNAME = 9
, SCE_RB_OPERATOR = 10
, SCE_RB_IDENTIFIER = 11
, SCE_RB_REGEX = 12
, SCE_RB_GLOBAL = 13
, SCE_RB_SYMBOL = 14
, SCE_RB_MODULE_NAME = 15
, SCE_RB_INSTANCE_VAR = 16
, SCE_RB_CLASS_VAR = 17
, SCE_RB_BACKTICKS = 18
, SCE_RB_DATASECTION = 19
, SCE_RB_HERE_DELIM = 20
, SCE_RB_HERE_Q = 21
, SCE_RB_HERE_QQ = 22
, SCE_RB_HERE_QX = 23
, SCE_RB_STRING_Q = 24
, SCE_RB_STRING_QQ = 25
, SCE_RB_STRING_QX = 26
, SCE_RB_STRING_QR = 27
, SCE_RB_STRING_QW = 28
, SCE_RB_WORD_DEMOTED = 29
, SCE_RB_STDIN = 30
, SCE_RB_STDOUT = 31
, SCE_RB_STDERR = 40
, SCE_RB_UPPER_BOUND = 41
, SCE_B_DEFAULT = 0
, SCE_B_COMMENT = 1
, SCE_B_NUMBER = 2
, SCE_B_KEYWORD = 3
, SCE_B_STRING = 4
, SCE_B_PREPROCESSOR = 5
, SCE_B_OPERATOR = 6
, SCE_B_IDENTIFIER = 7
, SCE_B_DATE = 8
, SCE_B_STRINGEOL = 9
, SCE_B_KEYWORD2 = 10
, SCE_B_KEYWORD3 = 11
, SCE_B_KEYWORD4 = 12
, SCE_B_CONSTANT = 13
, SCE_B_ASM = 14
, SCE_B_LABEL = 15
, SCE_B_ERROR = 16
, SCE_B_HEXNUMBER = 17
, SCE_B_BINNUMBER = 18
, SCE_PROPS_DEFAULT = 0
, SCE_PROPS_COMMENT = 1
, SCE_PROPS_SECTION = 2
, SCE_PROPS_ASSIGNMENT = 3
, SCE_PROPS_DEFVAL = 4
, SCE_L_DEFAULT = 0
, SCE_L_COMMAND = 1
, SCE_L_TAG = 2
, SCE_L_MATH = 3
, SCE_L_COMMENT = 4
, SCE_LUA_DEFAULT = 0
, SCE_LUA_COMMENT = 1
, SCE_LUA_COMMENTLINE = 2
, SCE_LUA_COMMENTDOC = 3
, SCE_LUA_NUMBER = 4
, SCE_LUA_WORD = 5
, SCE_LUA_STRING = 6
, SCE_LUA_CHARACTER = 7
, SCE_LUA_LITERALSTRING = 8
, SCE_LUA_PREPROCESSOR = 9
, SCE_LUA_OPERATOR = 10
, SCE_LUA_IDENTIFIER = 11
, SCE_LUA_STRINGEOL = 12
, SCE_LUA_WORD2 = 13
, SCE_LUA_WORD3 = 14
, SCE_LUA_WORD4 = 15
, SCE_LUA_WORD5 = 16
, SCE_LUA_WORD6 = 17
, SCE_LUA_WORD7 = 18
, SCE_LUA_WORD8 = 19
, SCE_ERR_DEFAULT = 0
, SCE_ERR_PYTHON = 1
, SCE_ERR_GCC = 2
, SCE_ERR_MS = 3
, SCE_ERR_CMD = 4
, SCE_ERR_BORLAND = 5
, SCE_ERR_PERL = 6
, SCE_ERR_NET = 7
, SCE_ERR_LUA = 8
, SCE_ERR_CTAG = 9
, SCE_ERR_DIFF_CHANGED = 10
, SCE_ERR_DIFF_ADDITION = 11
, SCE_ERR_DIFF_DELETION = 12
, SCE_ERR_DIFF_MESSAGE = 13
, SCE_ERR_PHP = 14
, SCE_ERR_ELF = 15
, SCE_ERR_IFC = 16
, SCE_ERR_IFORT = 17
, SCE_ERR_ABSF = 18
, SCE_ERR_TIDY = 19
, SCE_ERR_JAVA_STACK = 20
, SCE_BAT_DEFAULT = 0
, SCE_BAT_COMMENT = 1
, SCE_BAT_WORD = 2
, SCE_BAT_LABEL = 3
, SCE_BAT_HIDE = 4
, SCE_BAT_COMMAND = 5
, SCE_BAT_IDENTIFIER = 6
, SCE_BAT_OPERATOR = 7
, SCE_MAKE_DEFAULT = 0
, SCE_MAKE_COMMENT = 1
, SCE_MAKE_PREPROCESSOR = 2
, SCE_MAKE_IDENTIFIER = 3
, SCE_MAKE_OPERATOR = 4
, SCE_MAKE_TARGET = 5
, SCE_MAKE_IDEOL = 9
, SCE_DIFF_DEFAULT = 0
, SCE_DIFF_COMMENT = 1
, SCE_DIFF_COMMAND = 2
, SCE_DIFF_HEADER = 3
, SCE_DIFF_POSITION = 4
, SCE_DIFF_DELETED = 5
, SCE_DIFF_ADDED = 6
, SCE_CONF_DEFAULT = 0
, SCE_CONF_COMMENT = 1
, SCE_CONF_NUMBER = 2
, SCE_CONF_IDENTIFIER = 3
, SCE_CONF_EXTENSION = 4
, SCE_CONF_PARAMETER = 5
, SCE_CONF_STRING = 6
, SCE_CONF_OPERATOR = 7
, SCE_CONF_IP = 8
, SCE_CONF_DIRECTIVE = 9
, SCE_AVE_DEFAULT = 0
, SCE_AVE_COMMENT = 1
, SCE_AVE_NUMBER = 2
, SCE_AVE_WORD = 3
, SCE_AVE_STRING = 6
, SCE_AVE_ENUM = 7
, SCE_AVE_STRINGEOL = 8
, SCE_AVE_IDENTIFIER = 9
, SCE_AVE_OPERATOR = 10
, SCE_AVE_WORD1 = 11
, SCE_AVE_WORD2 = 12
, SCE_AVE_WORD3 = 13
, SCE_AVE_WORD4 = 14
, SCE_AVE_WORD5 = 15
, SCE_AVE_WORD6 = 16
, SCE_ADA_DEFAULT = 0
, SCE_ADA_WORD = 1
, SCE_ADA_IDENTIFIER = 2
, SCE_ADA_NUMBER = 3
, SCE_ADA_DELIMITER = 4
, SCE_ADA_CHARACTER = 5
, SCE_ADA_CHARACTEREOL = 6
, SCE_ADA_STRING = 7
, SCE_ADA_STRINGEOL = 8
, SCE_ADA_LABEL = 9
, SCE_ADA_COMMENTLINE = 10
, SCE_ADA_ILLEGAL = 11
, SCE_BAAN_DEFAULT = 0
, SCE_BAAN_COMMENT = 1
, SCE_BAAN_COMMENTDOC = 2
, SCE_BAAN_NUMBER = 3
, SCE_BAAN_WORD = 4
, SCE_BAAN_STRING = 5
, SCE_BAAN_PREPROCESSOR = 6
, SCE_BAAN_OPERATOR = 7
, SCE_BAAN_IDENTIFIER = 8
, SCE_BAAN_STRINGEOL = 9
, SCE_BAAN_WORD2 = 10
, SCE_LISP_DEFAULT = 0
, SCE_LISP_COMMENT = 1
, SCE_LISP_NUMBER = 2
, SCE_LISP_KEYWORD = 3
, SCE_LISP_KEYWORD_KW = 4
, SCE_LISP_SYMBOL = 5
, SCE_LISP_STRING = 6
, SCE_LISP_STRINGEOL = 8
, SCE_LISP_IDENTIFIER = 9
, SCE_LISP_OPERATOR = 10
, SCE_LISP_SPECIAL = 11
, SCE_LISP_MULTI_COMMENT = 12
, SCE_EIFFEL_DEFAULT = 0
, SCE_EIFFEL_COMMENTLINE = 1
, SCE_EIFFEL_NUMBER = 2
, SCE_EIFFEL_WORD = 3
, SCE_EIFFEL_STRING = 4
, SCE_EIFFEL_CHARACTER = 5
, SCE_EIFFEL_OPERATOR = 6
, SCE_EIFFEL_IDENTIFIER = 7
, SCE_EIFFEL_STRINGEOL = 8
, SCE_NNCRONTAB_DEFAULT = 0
, SCE_NNCRONTAB_COMMENT = 1
, SCE_NNCRONTAB_TASK = 2
, SCE_NNCRONTAB_SECTION = 3
, SCE_NNCRONTAB_KEYWORD = 4
, SCE_NNCRONTAB_MODIFIER = 5
, SCE_NNCRONTAB_ASTERISK = 6
, SCE_NNCRONTAB_NUMBER = 7
, SCE_NNCRONTAB_STRING = 8
, SCE_NNCRONTAB_ENVIRONMENT = 9
, SCE_NNCRONTAB_IDENTIFIER = 10
, SCE_FORTH_DEFAULT = 0
, SCE_FORTH_COMMENT = 1
, SCE_FORTH_COMMENT_ML = 2
, SCE_FORTH_IDENTIFIER = 3
, SCE_FORTH_CONTROL = 4
, SCE_FORTH_KEYWORD = 5
, SCE_FORTH_DEFWORD = 6
, SCE_FORTH_PREWORD1 = 7
, SCE_FORTH_PREWORD2 = 8
, SCE_FORTH_NUMBER = 9
, SCE_FORTH_STRING = 10
, SCE_FORTH_LOCALE = 11
, SCE_MATLAB_DEFAULT = 0
, SCE_MATLAB_COMMENT = 1
, SCE_MATLAB_COMMAND = 2
, SCE_MATLAB_NUMBER = 3
, SCE_MATLAB_KEYWORD = 4
, SCE_MATLAB_STRING = 5
, SCE_MATLAB_OPERATOR = 6
, SCE_MATLAB_IDENTIFIER = 7
, SCE_MATLAB_DOUBLEQUOTESTRING = 8
, SCE_SCRIPTOL_DEFAULT = 0
, SCE_SCRIPTOL_WHITE = 1
, SCE_SCRIPTOL_COMMENTLINE = 2
, SCE_SCRIPTOL_PERSISTENT = 3
, SCE_SCRIPTOL_CSTYLE = 4
, SCE_SCRIPTOL_COMMENTBLOCK = 5
, SCE_SCRIPTOL_NUMBER = 6
, SCE_SCRIPTOL_STRING = 7
, SCE_SCRIPTOL_CHARACTER = 8
, SCE_SCRIPTOL_STRINGEOL = 9
, SCE_SCRIPTOL_KEYWORD = 10
, SCE_SCRIPTOL_OPERATOR = 11
, SCE_SCRIPTOL_IDENTIFIER = 12
, SCE_SCRIPTOL_TRIPLE = 13
, SCE_SCRIPTOL_CLASSNAME = 14
, SCE_SCRIPTOL_PREPROCESSOR = 15
, SCE_ASM_DEFAULT = 0
, SCE_ASM_COMMENT = 1
, SCE_ASM_NUMBER = 2
, SCE_ASM_STRING = 3
, SCE_ASM_OPERATOR = 4
, SCE_ASM_IDENTIFIER = 5
, SCE_ASM_CPUINSTRUCTION = 6
, SCE_ASM_MATHINSTRUCTION = 7
, SCE_ASM_REGISTER = 8
, SCE_ASM_DIRECTIVE = 9
, SCE_ASM_DIRECTIVEOPERAND = 10
, SCE_ASM_COMMENTBLOCK = 11
, SCE_ASM_CHARACTER = 12
, SCE_ASM_STRINGEOL = 13
, SCE_ASM_EXTINSTRUCTION = 14
, SCE_F_DEFAULT = 0
, SCE_F_COMMENT = 1
, SCE_F_NUMBER = 2
, SCE_F_STRING1 = 3
, SCE_F_STRING2 = 4
, SCE_F_STRINGEOL = 5
, SCE_F_OPERATOR = 6
, SCE_F_IDENTIFIER = 7
, SCE_F_WORD = 8
, SCE_F_WORD2 = 9
, SCE_F_WORD3 = 10
, SCE_F_PREPROCESSOR = 11
, SCE_F_OPERATOR2 = 12
, SCE_F_LABEL = 13
, SCE_F_CONTINUATION = 14
, SCE_CSS_DEFAULT = 0
, SCE_CSS_TAG = 1
, SCE_CSS_CLASS = 2
, SCE_CSS_PSEUDOCLASS = 3
, SCE_CSS_UNKNOWN_PSEUDOCLASS = 4
, SCE_CSS_OPERATOR = 5
, SCE_CSS_IDENTIFIER = 6
, SCE_CSS_UNKNOWN_IDENTIFIER = 7
, SCE_CSS_VALUE = 8
, SCE_CSS_COMMENT = 9
, SCE_CSS_ID = 10
, SCE_CSS_IMPORTANT = 11
, SCE_CSS_DIRECTIVE = 12
, SCE_CSS_DOUBLESTRING = 13
, SCE_CSS_SINGLESTRING = 14
, SCE_CSS_IDENTIFIER2 = 15
, SCE_CSS_ATTRIBUTE = 16
, SCE_POV_DEFAULT = 0
, SCE_POV_COMMENT = 1
, SCE_POV_COMMENTLINE = 2
, SCE_POV_NUMBER = 3
, SCE_POV_OPERATOR = 4
, SCE_POV_IDENTIFIER = 5
, SCE_POV_STRING = 6
, SCE_POV_STRINGEOL = 7
, SCE_POV_DIRECTIVE = 8
, SCE_POV_BADDIRECTIVE = 9
, SCE_POV_WORD2 = 10
, SCE_POV_WORD3 = 11
, SCE_POV_WORD4 = 12
, SCE_POV_WORD5 = 13
, SCE_POV_WORD6 = 14
, SCE_POV_WORD7 = 15
, SCE_POV_WORD8 = 16
, SCE_LOUT_DEFAULT = 0
, SCE_LOUT_COMMENT = 1
, SCE_LOUT_NUMBER = 2
, SCE_LOUT_WORD = 3
, SCE_LOUT_WORD2 = 4
, SCE_LOUT_WORD3 = 5
, SCE_LOUT_WORD4 = 6
, SCE_LOUT_STRING = 7
, SCE_LOUT_OPERATOR = 8
, SCE_LOUT_IDENTIFIER = 9
, SCE_LOUT_STRINGEOL = 10
, SCE_ESCRIPT_DEFAULT = 0
, SCE_ESCRIPT_COMMENT = 1
, SCE_ESCRIPT_COMMENTLINE = 2
, SCE_ESCRIPT_COMMENTDOC = 3
, SCE_ESCRIPT_NUMBER = 4
, SCE_ESCRIPT_WORD = 5
, SCE_ESCRIPT_STRING = 6
, SCE_ESCRIPT_OPERATOR = 7
, SCE_ESCRIPT_IDENTIFIER = 8
, SCE_ESCRIPT_BRACE = 9
, SCE_ESCRIPT_WORD2 = 10
, SCE_ESCRIPT_WORD3 = 11
, SCE_PS_DEFAULT = 0
, SCE_PS_COMMENT = 1
, SCE_PS_DSC_COMMENT = 2
, SCE_PS_DSC_VALUE = 3
, SCE_PS_NUMBER = 4
, SCE_PS_NAME = 5
, SCE_PS_KEYWORD = 6
, SCE_PS_LITERAL = 7
, SCE_PS_IMMEVAL = 8
, SCE_PS_PAREN_ARRAY = 9
, SCE_PS_PAREN_DICT = 10
, SCE_PS_PAREN_PROC = 11
, SCE_PS_TEXT = 12
, SCE_PS_HEXSTRING = 13
, SCE_PS_BASE85STRING = 14
, SCE_PS_BADSTRINGCHAR = 15
, SCE_NSIS_DEFAULT = 0
, SCE_NSIS_COMMENT = 1
, SCE_NSIS_STRINGDQ = 2
, SCE_NSIS_STRINGLQ = 3
, SCE_NSIS_STRINGRQ = 4
, SCE_NSIS_FUNCTION = 5
, SCE_NSIS_VARIABLE = 6
, SCE_NSIS_LABEL = 7
, SCE_NSIS_USERDEFINED = 8
, SCE_NSIS_SECTIONDEF = 9
, SCE_NSIS_SUBSECTIONDEF = 10
, SCE_NSIS_IFDEFINEDEF = 11
, SCE_NSIS_MACRODEF = 12
, SCE_NSIS_STRINGVAR = 13
, SCE_NSIS_NUMBER = 14
, SCE_NSIS_SECTIONGROUP = 15
, SCE_NSIS_PAGEEX = 16
, SCE_NSIS_FUNCTIONDEF = 17
, SCE_NSIS_COMMENTBOX = 18
, SCE_MMIXAL_LEADWS = 0
, SCE_MMIXAL_COMMENT = 1
, SCE_MMIXAL_LABEL = 2
, SCE_MMIXAL_OPCODE = 3
, SCE_MMIXAL_OPCODE_PRE = 4
, SCE_MMIXAL_OPCODE_VALID = 5
, SCE_MMIXAL_OPCODE_UNKNOWN = 6
, SCE_MMIXAL_OPCODE_POST = 7
, SCE_MMIXAL_OPERANDS = 8
, SCE_MMIXAL_NUMBER = 9
, SCE_MMIXAL_REF = 10
, SCE_MMIXAL_CHAR = 11
, SCE_MMIXAL_STRING = 12
, SCE_MMIXAL_REGISTER = 13
, SCE_MMIXAL_HEX = 14
, SCE_MMIXAL_OPERATOR = 15
, SCE_MMIXAL_SYMBOL = 16
, SCE_MMIXAL_INCLUDE = 17
, SCE_CLW_DEFAULT = 0
, SCE_CLW_LABEL = 1
, SCE_CLW_COMMENT = 2
, SCE_CLW_STRING = 3
, SCE_CLW_USER_IDENTIFIER = 4
, SCE_CLW_INTEGER_CONSTANT = 5
, SCE_CLW_REAL_CONSTANT = 6
, SCE_CLW_PICTURE_STRING = 7
, SCE_CLW_KEYWORD = 8
, SCE_CLW_COMPILER_DIRECTIVE = 9
, SCE_CLW_RUNTIME_EXPRESSIONS = 10
, SCE_CLW_BUILTIN_PROCEDURES_FUNCTION = 11
, SCE_CLW_STRUCTURE_DATA_TYPE = 12
, SCE_CLW_ATTRIBUTE = 13
, SCE_CLW_STANDARD_EQUATE = 14
, SCE_CLW_ERROR = 15
, SCE_CLW_DEPRECATED = 16
, SCE_LOT_DEFAULT = 0
, SCE_LOT_HEADER = 1
, SCE_LOT_BREAK = 2
, SCE_LOT_SET = 3
, SCE_LOT_PASS = 4
, SCE_LOT_FAIL = 5
, SCE_LOT_ABORT = 6
, SCE_YAML_DEFAULT = 0
, SCE_YAML_COMMENT = 1
, SCE_YAML_IDENTIFIER = 2
, SCE_YAML_KEYWORD = 3
, SCE_YAML_NUMBER = 4
, SCE_YAML_REFERENCE = 5
, SCE_YAML_DOCUMENT = 6
, SCE_YAML_TEXT = 7
, SCE_YAML_ERROR = 8
, SCE_TEX_DEFAULT = 0
, SCE_TEX_SPECIAL = 1
, SCE_TEX_GROUP = 2
, SCE_TEX_SYMBOL = 3
, SCE_TEX_COMMAND = 4
, SCE_TEX_TEXT = 5
, SCE_METAPOST_DEFAULT = 0
, SCE_METAPOST_SPECIAL = 1
, SCE_METAPOST_GROUP = 2
, SCE_METAPOST_SYMBOL = 3
, SCE_METAPOST_COMMAND = 4
, SCE_METAPOST_TEXT = 5
, SCE_METAPOST_EXTRA = 6
, SCE_ERLANG_DEFAULT = 0
, SCE_ERLANG_COMMENT = 1
, SCE_ERLANG_VARIABLE = 2
, SCE_ERLANG_NUMBER = 3
, SCE_ERLANG_KEYWORD = 4
, SCE_ERLANG_STRING = 5
, SCE_ERLANG_OPERATOR = 6
, SCE_ERLANG_ATOM = 7
, SCE_ERLANG_FUNCTION_NAME = 8
, SCE_ERLANG_CHARACTER = 9
, SCE_ERLANG_MACRO = 10
, SCE_ERLANG_RECORD = 11
, SCE_ERLANG_SEPARATOR = 12
, SCE_ERLANG_NODE_NAME = 13
, SCE_ERLANG_UNKNOWN = 31
, SCE_MSSQL_DEFAULT = 0
, SCE_MSSQL_COMMENT = 1
, SCE_MSSQL_LINE_COMMENT = 2
, SCE_MSSQL_NUMBER = 3
, SCE_MSSQL_STRING = 4
, SCE_MSSQL_OPERATOR = 5
, SCE_MSSQL_IDENTIFIER = 6
, SCE_MSSQL_VARIABLE = 7
, SCE_MSSQL_COLUMN_NAME = 8
, SCE_MSSQL_STATEMENT = 9
, SCE_MSSQL_DATATYPE = 10
, SCE_MSSQL_SYSTABLE = 11
, SCE_MSSQL_GLOBAL_VARIABLE = 12
, SCE_MSSQL_FUNCTION = 13
, SCE_MSSQL_STORED_PROCEDURE = 14
, SCE_MSSQL_DEFAULT_PREF_DATATYPE = 15
, SCE_MSSQL_COLUMN_NAME_2 = 16
, SCE_V_DEFAULT = 0
, SCE_V_COMMENT = 1
, SCE_V_COMMENTLINE = 2
, SCE_V_COMMENTLINEBANG = 3
, SCE_V_NUMBER = 4
, SCE_V_WORD = 5
, SCE_V_STRING = 6
, SCE_V_WORD2 = 7
, SCE_V_WORD3 = 8
, SCE_V_PREPROCESSOR = 9
, SCE_V_OPERATOR = 10
, SCE_V_IDENTIFIER = 11
, SCE_V_STRINGEOL = 12
, SCE_V_USER = 19
, SCE_KIX_DEFAULT = 0
, SCE_KIX_COMMENT = 1
, SCE_KIX_STRING1 = 2
, SCE_KIX_STRING2 = 3
, SCE_KIX_NUMBER = 4
, SCE_KIX_VAR = 5
, SCE_KIX_MACRO = 6
, SCE_KIX_KEYWORD = 7
, SCE_KIX_FUNCTIONS = 8
, SCE_KIX_OPERATOR = 9
, SCE_KIX_IDENTIFIER = 31
, SCE_GC_DEFAULT = 0
, SCE_GC_COMMENTLINE = 1
, SCE_GC_COMMENTBLOCK = 2
, SCE_GC_GLOBAL = 3
, SCE_GC_EVENT = 4
, SCE_GC_ATTRIBUTE = 5
, SCE_GC_CONTROL = 6
, SCE_GC_COMMAND = 7
, SCE_GC_STRING = 8
, SCE_GC_OPERATOR = 9
, SCE_SN_DEFAULT = 0
, SCE_SN_CODE = 1
, SCE_SN_COMMENTLINE = 2
, SCE_SN_COMMENTLINEBANG = 3
, SCE_SN_NUMBER = 4
, SCE_SN_WORD = 5
, SCE_SN_STRING = 6
, SCE_SN_WORD2 = 7
, SCE_SN_WORD3 = 8
, SCE_SN_PREPROCESSOR = 9
, SCE_SN_OPERATOR = 10
, SCE_SN_IDENTIFIER = 11
, SCE_SN_STRINGEOL = 12
, SCE_SN_REGEXTAG = 13
, SCE_SN_SIGNAL = 14
, SCE_SN_USER = 19
, SCE_AU3_DEFAULT = 0
, SCE_AU3_COMMENT = 1
, SCE_AU3_COMMENTBLOCK = 2
, SCE_AU3_NUMBER = 3
, SCE_AU3_FUNCTION = 4
, SCE_AU3_KEYWORD = 5
, SCE_AU3_MACRO = 6
, SCE_AU3_STRING = 7
, SCE_AU3_OPERATOR = 8
, SCE_AU3_VARIABLE = 9
, SCE_AU3_SENT = 10
, SCE_AU3_PREPROCESSOR = 11
, SCE_AU3_SPECIAL = 12
, SCE_AU3_EXPAND = 13
, SCE_AU3_COMOBJ = 14
, SCE_APDL_DEFAULT = 0
, SCE_APDL_COMMENT = 1
, SCE_APDL_COMMENTBLOCK = 2
, SCE_APDL_NUMBER = 3
, SCE_APDL_STRING = 4
, SCE_APDL_OPERATOR = 5
, SCE_APDL_WORD = 6
, SCE_APDL_PROCESSOR = 7
, SCE_APDL_COMMAND = 8
, SCE_APDL_SLASHCOMMAND = 9
, SCE_APDL_STARCOMMAND = 10
, SCE_APDL_ARGUMENT = 11
, SCE_APDL_FUNCTION = 12
, SCE_SH_DEFAULT = 0
, SCE_SH_ERROR = 1
, SCE_SH_COMMENTLINE = 2
, SCE_SH_NUMBER = 3
, SCE_SH_WORD = 4
, SCE_SH_STRING = 5
, SCE_SH_CHARACTER = 6
, SCE_SH_OPERATOR = 7
, SCE_SH_IDENTIFIER = 8
, SCE_SH_SCALAR = 9
, SCE_SH_PARAM = 10
, SCE_SH_BACKTICKS = 11
, SCE_SH_HERE_DELIM = 12
, SCE_SH_HERE_Q = 13
, SCE_ASN1_DEFAULT = 0
, SCE_ASN1_COMMENT = 1
, SCE_ASN1_IDENTIFIER = 2
, SCE_ASN1_STRING = 3
, SCE_ASN1_OID = 4
, SCE_ASN1_SCALAR = 5
, SCE_ASN1_KEYWORD = 6
, SCE_ASN1_ATTRIBUTE = 7
, SCE_ASN1_DESCRIPTOR = 8
, SCE_ASN1_TYPE = 9
, SCE_ASN1_OPERATOR = 10
, SCE_VHDL_DEFAULT = 0
, SCE_VHDL_COMMENT = 1
, SCE_VHDL_COMMENTLINEBANG = 2
, SCE_VHDL_NUMBER = 3
, SCE_VHDL_STRING = 4
, SCE_VHDL_OPERATOR = 5
, SCE_VHDL_IDENTIFIER = 6
, SCE_VHDL_STRINGEOL = 7
, SCE_VHDL_KEYWORD = 8
, SCE_VHDL_STDOPERATOR = 9
, SCE_VHDL_ATTRIBUTE = 10
, SCE_VHDL_STDFUNCTION = 11
, SCE_VHDL_STDPACKAGE = 12
, SCE_VHDL_STDTYPE = 13
, SCE_VHDL_USERWORD = 14
, SCE_CAML_DEFAULT = 0
, SCE_CAML_IDENTIFIER = 1
, SCE_CAML_TAGNAME = 2
, SCE_CAML_KEYWORD = 3
, SCE_CAML_KEYWORD2 = 4
, SCE_CAML_LINENUM = 5
, SCE_CAML_OPERATOR = 6
, SCE_CAML_NUMBER = 7
, SCE_CAML_CHAR = 8
, SCE_CAML_STRING = 9
, SCE_CAML_COMMENT = 10
, SCE_CAML_COMMENT1 = 11
, SCE_CAML_COMMENT2 = 12
, SCE_CAML_COMMENT3 = 13
, SCE_HA_DEFAULT = 0
, SCE_HA_IDENTIFIER = 1
, SCE_HA_KEYWORD = 2
, SCE_HA_NUMBER = 3
, SCE_HA_STRING = 4
, SCE_HA_CHARACTER = 5
, SCE_HA_CLASS = 6
, SCE_HA_MODULE = 7
, SCE_HA_CAPITAL = 8
, SCE_HA_DATA = 9
, SCE_HA_IMPORT = 10
, SCE_HA_OPERATOR = 11
, SCE_HA_INSTANCE = 12
, SCE_HA_COMMENTLINE = 13
, SCE_HA_COMMENTBLOCK = 14
, SCE_HA_COMMENTBLOCK2 = 15
, SCE_HA_COMMENTBLOCK3 = 16
, SCE_T3_DEFAULT = 0
, SCE_T3_X_DEFAULT = 1
, SCE_T3_PREPROCESSOR = 2
, SCE_T3_BLOCK_COMMENT = 3
, SCE_T3_LINE_COMMENT = 4
, SCE_T3_OPERATOR = 5
, SCE_T3_KEYWORD = 6
, SCE_T3_NUMBER = 7
, SCE_T3_IDENTIFIER = 8
, SCE_T3_S_STRING = 9
, SCE_T3_D_STRING = 10
, SCE_T3_X_STRING = 11
, SCE_T3_LIB_DIRECTIVE = 12
, SCE_T3_MSG_PARAM = 13
, SCE_T3_HTML_TAG = 14
, SCE_T3_HTML_DEFAULT = 15
, SCE_T3_HTML_STRING = 16
, SCE_T3_USER1 = 17
, SCE_T3_USER2 = 18
, SCE_T3_USER3 = 19
, SCE_REBOL_DEFAULT = 0
, SCE_REBOL_COMMENTLINE = 1
, SCE_REBOL_COMMENTBLOCK = 2
, SCE_REBOL_PREFACE = 3
, SCE_REBOL_OPERATOR = 4
, SCE_REBOL_CHARACTER = 5
, SCE_REBOL_QUOTEDSTRING = 6
, SCE_REBOL_BRACEDSTRING = 7
, SCE_REBOL_NUMBER = 8
, SCE_REBOL_PAIR = 9
, SCE_REBOL_TUPLE = 10
, SCE_REBOL_BINARY = 11
, SCE_REBOL_MONEY = 12
, SCE_REBOL_ISSUE = 13
, SCE_REBOL_TAG = 14
, SCE_REBOL_FILE = 15
, SCE_REBOL_EMAIL = 16
, SCE_REBOL_URL = 17
, SCE_REBOL_DATE = 18
, SCE_REBOL_TIME = 19
, SCE_REBOL_IDENTIFIER = 20
, SCE_REBOL_WORD = 21
, SCE_REBOL_WORD2 = 22
, SCE_REBOL_WORD3 = 23
, SCE_REBOL_WORD4 = 24
, SCE_REBOL_WORD5 = 25
, SCE_REBOL_WORD6 = 26
, SCE_REBOL_WORD7 = 27
, SCE_REBOL_WORD8 = 28
, SCE_SQL_DEFAULT = 0
, SCE_SQL_COMMENT = 1
, SCE_SQL_COMMENTLINE = 2
, SCE_SQL_COMMENTDOC = 3
, SCE_SQL_NUMBER = 4
, SCE_SQL_WORD = 5
, SCE_SQL_STRING = 6
, SCE_SQL_CHARACTER = 7
, SCE_SQL_SQLPLUS = 8
, SCE_SQL_SQLPLUS_PROMPT = 9
, SCE_SQL_OPERATOR = 10
, SCE_SQL_IDENTIFIER = 11
, SCE_SQL_SQLPLUS_COMMENT = 13
, SCE_SQL_COMMENTLINEDOC = 15
, SCE_SQL_WORD2 = 16
, SCE_SQL_COMMENTDOCKEYWORD = 17
, SCE_SQL_COMMENTDOCKEYWORDERROR = 18
, SCE_SQL_USER1 = 19
, SCE_SQL_USER2 = 20
, SCE_SQL_USER3 = 21
, SCE_SQL_USER4 = 22
, SCE_ST_DEFAULT = 0
, SCE_ST_STRING = 1
, SCE_ST_NUMBER = 2
, SCE_ST_COMMENT = 3
, SCE_ST_SYMBOL = 4
, SCE_ST_BINARY = 5
, SCE_ST_BOOL = 6
, SCE_ST_SELF = 7
, SCE_ST_SUPER = 8
, SCE_ST_NIL = 9
, SCE_ST_GLOBAL = 10
, SCE_ST_RETURN = 11
, SCE_ST_SPECIAL = 12
, SCE_ST_KWSEND = 13
, SCE_ST_ASSIGN = 14
, SCE_ST_CHARACTER = 15
, SCE_ST_SPEC_SEL = 16
, SCE_FS_DEFAULT = 0
, SCE_FS_COMMENT = 1
, SCE_FS_COMMENTLINE = 2
, SCE_FS_COMMENTDOC = 3
, SCE_FS_COMMENTLINEDOC = 4
, SCE_FS_COMMENTDOCKEYWORD = 5
, SCE_FS_COMMENTDOCKEYWORDERROR = 6
, SCE_FS_KEYWORD = 7
, SCE_FS_KEYWORD2 = 8
, SCE_FS_KEYWORD3 = 9
, SCE_FS_KEYWORD4 = 10
, SCE_FS_NUMBER = 11
, SCE_FS_STRING = 12
, SCE_FS_PREPROCESSOR = 13
, SCE_FS_OPERATOR = 14
, SCE_FS_IDENTIFIER = 15
, SCE_FS_DATE = 16
, SCE_FS_STRINGEOL = 17
, SCE_FS_CONSTANT = 18
, SCE_FS_ASM = 19
, SCE_FS_LABEL = 20
, SCE_FS_ERROR = 21
, SCE_FS_HEXNUMBER = 22
, SCE_FS_BINNUMBER = 23
, SCE_CSOUND_DEFAULT = 0
, SCE_CSOUND_COMMENT = 1
, SCE_CSOUND_NUMBER = 2
, SCE_CSOUND_OPERATOR = 3
, SCE_CSOUND_INSTR = 4
, SCE_CSOUND_IDENTIFIER = 5
, SCE_CSOUND_OPCODE = 6
, SCE_CSOUND_HEADERSTMT = 7
, SCE_CSOUND_USERKEYWORD = 8
, SCE_CSOUND_COMMENTBLOCK = 9
, SCE_CSOUND_PARAM = 10
, SCE_CSOUND_ARATE_VAR = 11
, SCE_CSOUND_KRATE_VAR = 12
, SCE_CSOUND_IRATE_VAR = 13
, SCE_CSOUND_GLOBAL_VAR = 14
, SCE_CSOUND_STRINGEOL = 15
, SCLEX_ASP = 29
, SCLEX_PHP = 30
//--Autogenerated -- end of section automatically generated from Scintilla.iface
	
};

	extern (C) alias int function(int DirectPointer, int msg, int wparam, int lparam) SciFnDirect;

	private static WNDPROC_I ScintillaProc;
	private static HINSTANCE _handleOfDLL;
	private static int instCount = 0;	
	private static const char[] ScintillaClass = "Scintilla";
	private static const char[] ScintillaDll = "SciLexer.dll";
	private static char[] dllToUse = null;
	
	
	SCNotifyHandler[] notifyHandlers;
	SciFnDirect directFunction = null;
	int directPointer;
	boolean _enableDirectFunc = true;
	
/**
 * set the dll file name for scintilla, must be invoked before any Scintilla instance created, 
 * and invoke only once. For example, you can set the dll name to "dlex.dll", which is a D syntax supported scintilla
 * modification by Vathix. http://wiki.dprogramming.com/DLex/HomePage
 * 
 */
public static void setDllFileName(char[] dllFileName) {
	if(instCount == 0)
		dllToUse = dllFileName.dup;
}	

private static void staticCtor() {
	if(_handleOfDLL !is null) return;
	if(dllToUse is null)
		dllToUse = ScintillaDll;
	_handleOfDLL = OS.LoadLibrary(Converter.StrToTCHARz(dllToUse));
	
	// try to load standard 
	if(_handleOfDLL is null)
		_handleOfDLL = OS.LoadLibrary(Converter.StrToTCHARz(ScintillaDll));
	if(_handleOfDLL is null)
		_handleOfDLL = OS.LoadLibrary("Scintilla.dll\0");
	
	if(_handleOfDLL is null){
		char[] errStr = Display.getLastErrorText();
		errStr ~= "\nLoadLibrary Failed : " ~ dllToUse;
		MessageBox.showMsg(errStr[], "Error", null, DWT.OK|DWT.ICON_ERROR | DWT.APPLICATION_MODAL);
		return;
	}
	
	assert(_handleOfDLL);
		
	WNDCLASS_T lpWndClass;
	OS.GetClassInfo (null, Converter.StrToTCHARz(ScintillaClass), &lpWndClass);
	ScintillaProc = lpWndClass.lpfnWndProc;
}

this (Composite parent, int style) {
	assert(parent);
	staticCtor();
	super(parent, style | DWT.V_SCROLL | DWT.H_SCROLL);
	
	if(handle !is null) {
		directFunction = getDirectFunction();
		directPointer = getDirectPointer();
		
		// increase the instance count
		++instCount;
		
		// handle dispose event, decrease the count. 
		// or override the dispose() method to do so
		handleDispose(null, delegate(DisposeEvent e) {
			--instCount;
		});
		
		// when the display disposed, check the instance count 
		getDisplay().handleEvent(null, DWT.Dispose, delegate(Event e) {
			// No scintilla instance exists now, safe to free dll
			if(Scintilla.instCount == 0 && Scintilla._handleOfDLL !is null){
				OS.FreeLibrary(Scintilla._handleOfDLL);
				Scintilla._handleOfDLL = null;
				Scintilla.ScintillaProc = null;
			}
		});
	}

}

// property getter and setter
// global enable or disable Direct Function
void enableDirectFunc(boolean enable) { _enableDirectFunc = enable; }

boolean enableDirectFunc() { return _enableDirectFunc; }

static int handleOfDLL() { return cast(int)_handleOfDLL; }
	
LRESULT callWindowProc (int msg, int wParam, int lParam) {
	if (handle is null) return 0;
	return OS.CallWindowProc (ScintillaProc, handle, msg, wParam, lParam);
}

char[] windowClass() {
	return ScintillaClass;
}

WNDPROC_I windowProc2 () {
	return ScintillaProc;
}

int widgetStyle () {
	int bits = super.widgetStyle ();
	bits |= OS.WS_TABSTOP;
	return bits;
}

int sendMessage (int msg, int wparam = 0, int lparam = 0){
	return OS.SendMessage(handle, msg, wparam, lparam);
}

void handleNotify(Object customData, int type, void delegate(SCNotifyEvent) func) 
{
	notifyHandlers ~= new SCNotifyHandler(customData, type, func);
}


// the basic method
int call(int msg, int wparam = 0, int lparam = 0, bool bDirect = true )
{
	assert(handle);	//Window must be valid
	
	if (bDirect && directFunction && _enableDirectFunc)
  	{
    	assert(directFunction); //Direct function must be valid
    	return (*directFunction)(directPointer, msg, wparam, lparam);
  	}
  	else
    	return OS.SendMessage(handle, msg, wparam, lparam);
}


int call(int msg, int wparam, TextToFind* lparam, bool bDirect = true ){
	return call(msg, wparam, cast(int)lparam, bDirect);
}

int call(int msg, int wparam, TextRange* lparam, bool bDirect = true ){
	assert(lparam);
	assert(lparam.end >= lparam.start);
	
	int len = lparam.end - lparam.start;
	lparam.text = new char[len + 1]; 
	TextRange_C trc = TextRange_C(lparam);
	int result = call(msg, wparam, cast(int)&trc, bDirect);
	// remove the '\0' at the end
	lparam.text = lparam.text[0..len]; 
	return result;
}

/**
 * Note : only use char[] lparam as input, ie, this is const char*,
 * But not to receive strings
 */
int call(int msg, int wparam, char[] lparam, bool bDirect = true ){
	char* text = std.string.toStringz(lparam);
	return call(msg, wparam, cast(int)text, bDirect);
}

/**
 * Note : only use char[] lparam as input, ie, this is const char*,
 * But not to receive strings
 */
int call(int msg, char[] wparam, int lparam, bool bDirect = true ){
	// make sure a null line end exists
	char* text = std.string.toStringz(wparam);
	return call(msg, cast(int)text, lparam, bDirect);
}

/**
 * Note : only use char[] as input, ie, this is const char*, But not to receive
 * strings
 */
int call(int msg, char[] wparam, char[] lparam, bool bDirect = true ){
	char* wText = std.string.toStringz(wparam);
	char* lText = std.string.toStringz(lparam);
	return call(msg, cast(int)wText, cast(int)lText, bDirect);
}


SciFnDirect getDirectFunction()
{
return cast(SciFnDirect)OS.SendMessage(handle, SCI_GETDIRECTFUNCTION, 0, 0);
}

int getDirectPointer()
{
  return OS.SendMessage(handle, SCI_GETDIRECTPOINTER, 0, 0);
}

void doBraceMatching()
{
	// do brace matching
	uint lStart = getCurrentPos();
	uint lEnd =  braceMatch(lStart - 1);
	// if there is a matching brace highlight it
	if (lEnd >= 0)
		braceHighlight(lStart - 1, lEnd);
	// if there is NO matching brace erase old highlight
	else
		braceHighlight(-1, -1);
}

protected int onNotify(SCNotification_C* pSCNotification)
{
	assert(pSCNotification);
	
	int handled = 0;
	if(notifyHandlers.length > 0 )
	{
		// the D struct
		SCNotification scn = pSCNotification.generateScnEvent();
		
		foreach(SCNotifyHandler hand; notifyHandlers)
		{
			if(scn.code == hand.notifyType)
			{
				// fill the custom data(s) filed
				scn.cData = hand.cData;
				hand.scnFunc(&scn);
				++handled;
			}
		}
	}
	
	return handled;
}

LDWTRESULT wmNotifyChild (int wParam, int lParam) 
{
	NMHDR* hdr = cast(NMHDR*)lParam;
	if(hdr && hdr.hwndFrom is handle){
		SCNotification_C *pMsg = cast(SCNotification_C*)lParam;
		int result = onNotify(pMsg);
		if(result){ 
			return new LDWTRESULT(result);
		}		
	}
	return super.wmNotifyChild(wParam, lParam);
}

// The following methods may be generated automatically, but currently not 

char[] getSelText(bool bDirect = true)
{
	int nStartSel = getSelectionStart();
	int nEndSel = getSelectionEnd();
	int len = nEndSel - nStartSel;
	char[] text = new char[len + 1];	
	call(SCI_GETSELTEXT, 0, cast(int)cast(char*)text, bDirect);
	return text[0..len];
}

void addText(char[] text, bool bDirect = true)
{
  	call(SCI_ADDTEXT, text.length, text, bDirect);
}

void insertText(uint pos, char[] text, bool bDirect = true)
{
  call(SCI_INSERTTEXT, pos, text, bDirect);
}

void clearAll(bool bDirect = true)
{
  call(SCI_CLEARALL, 0, 0, bDirect);
}

void clearDocumentStyle(bool bDirect = true)
{
  call(SCI_CLEARDOCUMENTSTYLE, 0, 0, bDirect);
}

int getLength(bool bDirect = true)
{
  return call(SCI_GETLENGTH, 0, 0, bDirect);
}

int getCharAt(uint pos, bool bDirect = true)
{
  return call(SCI_GETCHARAT, pos, 0, bDirect);
}

uint getCurrentPos(bool bDirect = true)
{
  return call(SCI_GETCURRENTPOS, 0, 0, bDirect);
}

uint getAnchor(bool bDirect = true)
{
  return call(SCI_GETANCHOR, 0, 0, bDirect);
}

int getStyleAt(uint pos, bool bDirect = true)
{
  return call(SCI_GETSTYLEAT, pos, 0, bDirect);
}

void redo(bool bDirect = true)
{
  call(SCI_REDO, 0, 0, bDirect);
}

void setUndoCollection(BOOL collectUndo, bool bDirect = true)
{
  call(SCI_SETUNDOCOLLECTION, collectUndo, 0, bDirect);
}

void selectAll(bool bDirect = true)
{
  call(SCI_SELECTALL, 0, 0, bDirect);
}

void setSavePoint(bool bDirect = true)
{
  call(SCI_SETSAVEPOINT, 0, 0, bDirect);
}

int getStyledText(TextRange* tr, bool bDirect = true)
{
  return call(SCI_GETSTYLEDTEXT, 0, tr, bDirect);
}

BOOL canRedo(bool bDirect = true)
{
  return call(SCI_CANREDO, 0, 0, bDirect);
}

int markerLineFromHandle(int handle, bool bDirect = true)
{
  return call(SCI_MARKERLINEFROMHANDLE, handle, 0, bDirect);
}

void markerDeleteHandle(int handle, bool bDirect = true)
{
  call(SCI_MARKERDELETEHANDLE, handle, 0, bDirect);
}

BOOL getUndoCollection(bool bDirect = true)
{
  return call(SCI_GETUNDOCOLLECTION, 0, 0, bDirect);
}

int getViewWS(bool bDirect = true)
{
  return call(SCI_GETVIEWWS, 0, 0, bDirect);
}

void setViewWS(int viewWS, bool bDirect = true)
{
  call(SCI_SETVIEWWS, viewWS, 0, bDirect);
}

uint positionFromPoint(int x, int y, bool bDirect = true)
{
  return call(SCI_POSITIONFROMPOINT, x, y, bDirect);
}

uint positionFromPointClose(int x, int y, bool bDirect = true)
{
  return call(SCI_POSITIONFROMPOINTCLOSE, x, y, bDirect);
}

void gotoLine(int line, bool bDirect = true)
{
  call(SCI_GOTOLINE, line, 0, bDirect);
}

void gotoPos(uint pos, bool bDirect = true)
{
  call(SCI_GOTOPOS, pos, 0, bDirect);
}

void setAnchor(uint posAnchor, bool bDirect = true)
{
  call(SCI_SETANCHOR, posAnchor, 0, bDirect);
}

char[] getCurLine(bool bDirect = true)
{
	int curLineLength = call(SCI_GETCURLINE, 0, 0, bDirect);
	char[] text = new char[curLineLength + 1];
	call(SCI_GETCURLINE, curLineLength + 1, cast(int)cast(char*)text, bDirect);
	
  	return text[0..curLineLength];
}

uint getEndStyled(bool bDirect = true)
{
  return call(SCI_GETENDSTYLED, 0, 0, bDirect);
}

void convertEOLs(int eolMode, bool bDirect = true)
{
  call(SCI_CONVERTEOLS, eolMode, 0, bDirect);
}

int getEOLMode(bool bDirect = true)
{
  return call(SCI_GETEOLMODE, 0, 0, bDirect);
}

void setEOLMode(int eolMode, bool bDirect = true)
{
  call(SCI_SETEOLMODE, eolMode, 0, bDirect);
}

void startStyling(uint pos, int mask, bool bDirect = true)
{
  call(SCI_STARTSTYLING, pos, mask, bDirect);
}

void setStyling(int length, int style, bool bDirect = true)
{
  call(SCI_SETSTYLING, length, style, bDirect);
}

BOOL getBufferedDraw(bool bDirect = true)
{
  return call(SCI_GETBUFFEREDDRAW, 0, 0, bDirect);
}

void setBufferedDraw(BOOL buffered, bool bDirect = true)
{
  call(SCI_SETBUFFEREDDRAW, buffered, 0, bDirect);
}

void setTabWidth(int tabWidth, bool bDirect = true)
{
  call(SCI_SETTABWIDTH, tabWidth, 0, bDirect);
}

int getTabWidth(bool bDirect = true)
{
  return call(SCI_GETTABWIDTH, 0, 0, bDirect);
}

void setCodePage(int codePage, bool bDirect = true)
{
  call(SCI_SETCODEPAGE, codePage, 0, bDirect);
}

void setUsePalette(BOOL usePalette, bool bDirect = true)
{
  call(SCI_SETUSEPALETTE, usePalette, 0, bDirect);
}

void markerDefine(int markerNumber, int markerSymbol, bool bDirect = true)
{
  call(SCI_MARKERDEFINE, markerNumber, markerSymbol, bDirect);
}

void markerSetFore(int markerNumber, int fore, bool bDirect = true)
{
  call(SCI_MARKERSETFORE, markerNumber, fore, bDirect);
}

void markerSetBack(int markerNumber, int back, bool bDirect = true)
{
  call(SCI_MARKERSETBACK, markerNumber, back, bDirect);
}

int markerAdd(int line, int markerNumber, bool bDirect = true)
{
  return call(SCI_MARKERADD, line, markerNumber, bDirect);
}

void markerDelete(int line, int markerNumber, bool bDirect = true)
{
  call(SCI_MARKERDELETE, line, markerNumber, bDirect);
}

void markerDeleteAll(int markerNumber, bool bDirect = true)
{
  call(SCI_MARKERDELETEALL, markerNumber, 0, bDirect);
}

int markerGet(int line, bool bDirect = true)
{
  return call(SCI_MARKERGET, line, 0, bDirect);
}

int markerNext(int lineStart, int markerMask, bool bDirect = true)
{
  return call(SCI_MARKERNEXT, lineStart, markerMask, bDirect);
}

int markerPrevious(int lineStart, int markerMask, bool bDirect = true)
{
  return call(SCI_MARKERPREVIOUS, lineStart, markerMask, bDirect);
}

void markerDefinePixmap(int markerNumber, char[] pixmap, bool bDirect = true)
{
  call(SCI_MARKERDEFINEPIXMAP, markerNumber, pixmap, bDirect);
}

void setMarginTypeN(int margin, int marginType, bool bDirect = true)
{
  call(SCI_SETMARGINTYPEN, margin, marginType, bDirect);
}

int getMarginTypeN(int margin, bool bDirect = true)
{
  return call(SCI_GETMARGINTYPEN, margin, 0, bDirect);
}

void setMarginWidthN(int margin, int pixelWidth, bool bDirect = true)
{
  call(SCI_SETMARGINWIDTHN, margin, pixelWidth, bDirect);
}

int getMarginWidthN(int margin, bool bDirect = true)
{
  return call(SCI_GETMARGINWIDTHN, margin, 0, bDirect);
}

void setMarginMaskN(int margin, int mask, bool bDirect = true)
{
  call(SCI_SETMARGINMASKN, margin, mask, bDirect);
}

int getMarginMaskN(int margin, bool bDirect = true)
{
  return call(SCI_GETMARGINMASKN, margin, 0, bDirect);
}

void setMarginSensitiveN(int margin, BOOL sensitive, bool bDirect = true)
{
  call(SCI_SETMARGINSENSITIVEN, margin, sensitive, bDirect);
}

BOOL getMarginSensitiveN(int margin, bool bDirect = true)
{
  return call(SCI_GETMARGINSENSITIVEN, margin, 0, bDirect);
}

void styleClearAll(bool bDirect = true)
{
  call(SCI_STYLECLEARALL, 0, 0, bDirect);
}

void styleSetFore(int style, int fore, bool bDirect = true)
{
  call(SCI_STYLESETFORE, style, fore, bDirect);
}

void styleSetBack(int style, int back, bool bDirect = true)
{
  call(SCI_STYLESETBACK, style, back, bDirect);
}

void styleSetBold(int style, BOOL bold, bool bDirect = true)
{
  call(SCI_STYLESETBOLD, style, bold, bDirect);
}

void styleSetItalic(int style, BOOL italic, bool bDirect = true)
{
  call(SCI_STYLESETITALIC, style, italic, bDirect);
}

void styleSetSize(int style, int sizePoints, bool bDirect = true)
{
  call(SCI_STYLESETSIZE, style, sizePoints, bDirect);
}

void styleSetFont(int style, char[] fontName, bool bDirect = true)
{
  call(SCI_STYLESETFONT, style, fontName, bDirect);
}

void styleSetEOLFilled(int style, BOOL filled, bool bDirect = true)
{
  call(SCI_STYLESETEOLFILLED, style, filled, bDirect);
}

void styleResetDefault(bool bDirect = true)
{
  call(SCI_STYLERESETDEFAULT, 0, 0, bDirect);
}

void styleSetUnderline(int style, BOOL underline, bool bDirect = true)
{
  call(SCI_STYLESETUNDERLINE, style, underline, bDirect);
}

void styleSetCase(int style, int caseForce, bool bDirect = true)
{
  call(SCI_STYLESETCASE, style, caseForce, bDirect);
}

void styleSetCharacterSet(int style, int characterSet, bool bDirect = true)
{
  call(SCI_STYLESETCHARACTERSET, style, characterSet, bDirect);
}

void styleSetHotSpot(int style, BOOL hotspot, bool bDirect = true)
{
  call(SCI_STYLESETHOTSPOT, style, hotspot, bDirect);
}

void setSelFore(BOOL useSetting, int fore, bool bDirect = true)
{
  call(SCI_SETSELFORE, useSetting, fore, bDirect);
}

void setSelBack(BOOL useSetting, int back, bool bDirect = true)
{
  call(SCI_SETSELBACK, useSetting, back, bDirect);
}

void setCaretFore(int fore, bool bDirect = true)
{
  call(SCI_SETCARETFORE, fore, 0, bDirect);
}

void assignCmdKey(uint km, int msg, bool bDirect = true)
{
  call(SCI_ASSIGNCMDKEY, km, msg, bDirect);
}

void clearCmdKey(uint km, bool bDirect = true)
{
  call(SCI_CLEARCMDKEY, km, 0, bDirect);
}

void clearAllCmdKeys(bool bDirect = true)
{
  call(SCI_CLEARALLCMDKEYS, 0, 0, bDirect);
}

void setStylingEx(int length, char[] styles, bool bDirect = true)
{
  call(SCI_SETSTYLINGEX, length, styles, bDirect);
}

void styleSetVisible(int style, BOOL visible, bool bDirect = true)
{
  call(SCI_STYLESETVISIBLE, style, visible, bDirect);
}

int getCaretPeriod(bool bDirect = true)
{
  return call(SCI_GETCARETPERIOD, 0, 0, bDirect);
}

void setCaretPeriod(int periodMilliseconds, bool bDirect = true)
{
  call(SCI_SETCARETPERIOD, periodMilliseconds, 0, bDirect);
}

void setWordChars(char[] characters, bool bDirect = true)
{
  call(SCI_SETWORDCHARS, 0, characters, bDirect);
}

void beginUndoAction(bool bDirect = true)
{
  call(SCI_BEGINUNDOACTION, 0, 0, bDirect);
}

void endUndoAction(bool bDirect = true)
{
  call(SCI_ENDUNDOACTION, 0, 0, bDirect);
}

void indicSetStyle(int indic, int style, bool bDirect = true)
{
  call(SCI_INDICSETSTYLE, indic, style, bDirect);
}

int indicGetStyle(int indic, bool bDirect = true)
{
  return call(SCI_INDICGETSTYLE, indic, 0, bDirect);
}

void indicSetFore(int indic, int fore, bool bDirect = true)
{
  call(SCI_INDICSETFORE, indic, fore, bDirect);
}

int indicGetFore(int indic, bool bDirect = true)
{
  return call(SCI_INDICGETFORE, indic, 0, bDirect);
}

void setWhitespaceFore(BOOL useSetting, int fore, bool bDirect = true)
{
  call(SCI_SETWHITESPACEFORE, useSetting, fore, bDirect);
}

void setWhitespaceBack(BOOL useSetting, int back, bool bDirect = true)
{
  call(SCI_SETWHITESPACEBACK, useSetting, back, bDirect);
}

void setStyleBits(int bits, bool bDirect = true)
{
  call(SCI_SETSTYLEBITS, bits, 0, bDirect);
}

int getStyleBits(bool bDirect = true)
{
  return call(SCI_GETSTYLEBITS, 0, 0, bDirect);
}

void setLineState(int line, int state, bool bDirect = true)
{
  call(SCI_SETLINESTATE, line, state, bDirect);
}

int getLineState(int line, bool bDirect = true)
{
  return call(SCI_GETLINESTATE, line, 0, bDirect);
}

int getMaxLineState(bool bDirect = true)
{
  return call(SCI_GETMAXLINESTATE, 0, 0, bDirect);
}

BOOL getCaretLineVisible(bool bDirect = true)
{
  return call(SCI_GETCARETLINEVISIBLE, 0, 0, bDirect);
}

void setCaretLineVisible(BOOL show, bool bDirect = true)
{
  call(SCI_SETCARETLINEVISIBLE, show, 0, bDirect);
}

int getCaretLineBack(bool bDirect = true)
{
  return call(SCI_GETCARETLINEBACK, 0, 0, bDirect);
}

void setCaretLineBack(int back, bool bDirect = true)
{
  call(SCI_SETCARETLINEBACK, back, 0, bDirect);
}

void styleSetChangeable(int style, BOOL changeable, bool bDirect = true)
{
  call(SCI_STYLESETCHANGEABLE, style, changeable, bDirect);
}

void autoCShow(int lenEntered, char[] itemList, bool bDirect = true)
{
  call(SCI_AUTOCSHOW, lenEntered, itemList, bDirect);
}

void autoCCancel(bool bDirect = true)
{
  call(SCI_AUTOCCANCEL, 0, 0, bDirect);
}

BOOL autoCActive(bool bDirect = true)
{
  return call(SCI_AUTOCACTIVE, 0, 0, bDirect);
}

uint autoCPosStart(bool bDirect = true)
{
  return call(SCI_AUTOCPOSSTART, 0, 0, bDirect);
}

void autoCComplete(bool bDirect = true)
{
  call(SCI_AUTOCCOMPLETE, 0, 0, bDirect);
}

void autoCStops(char[] characterSet, bool bDirect = true)
{
  call(SCI_AUTOCSTOPS, 0, characterSet, bDirect);
}

void autoCSetSeparator(int separatorCharacter, bool bDirect = true)
{
  call(SCI_AUTOCSETSEPARATOR, separatorCharacter, 0, bDirect);
}

int autoCGetSeparator(bool bDirect = true)
{
  return call(SCI_AUTOCGETSEPARATOR, 0, 0, bDirect);
}

void autoCSelect(char[] text, bool bDirect = true)
{
	call(SCI_AUTOCSELECT, 0, text, bDirect);
}

void autoCSetCancelAtStart(BOOL cancel, bool bDirect = true)
{
  call(SCI_AUTOCSETCANCELATSTART, cancel, 0, bDirect);
}

BOOL autoCGetCancelAtStart(bool bDirect = true)
{
  return call(SCI_AUTOCGETCANCELATSTART, 0, 0, bDirect);
}

void autoCSetFillUps(char[] characterSet, bool bDirect = true)
{
  call(SCI_AUTOCSETFILLUPS, 0, characterSet, bDirect);
}

void autoCSetChooseSingle(BOOL chooseSingle, bool bDirect = true)
{
  call(SCI_AUTOCSETCHOOSESINGLE, chooseSingle, 0, bDirect);
}

BOOL autoCGetChooseSingle(bool bDirect = true)
{
  return call(SCI_AUTOCGETCHOOSESINGLE, 0, 0, bDirect);
}

void autoCSetIgnoreCase(BOOL ignoreCase, bool bDirect = true)
{
  call(SCI_AUTOCSETIGNORECASE, ignoreCase, 0, bDirect);
}

BOOL autoCGetIgnoreCase(bool bDirect = true)
{
  return call(SCI_AUTOCGETIGNORECASE, 0, 0, bDirect);
}

void userListShow(int listType, char[] itemList, bool bDirect = true)
{
  call(SCI_USERLISTSHOW, listType, itemList, bDirect);
}

void autoCSetAutoHide(BOOL autoHide, bool bDirect = true)
{
  call(SCI_AUTOCSETAUTOHIDE, autoHide, 0, bDirect);
}

BOOL autoCGetAutoHide(bool bDirect = true)
{
  return call(SCI_AUTOCGETAUTOHIDE, 0, 0, bDirect);
}

void autoCSetDropRestOfWord(BOOL dropRestOfWord, bool bDirect = true)
{
  call(SCI_AUTOCSETDROPRESTOFWORD, dropRestOfWord, 0, bDirect);
}

BOOL autoCGetDropRestOfWord(bool bDirect = true)
{
  return call(SCI_AUTOCGETDROPRESTOFWORD, 0, 0, bDirect);
}

void registerImage(int type, char[] xpmData, bool bDirect = true)
{
  call(SCI_REGISTERIMAGE, type, xpmData, bDirect);
}

void clearRegisteredImages(bool bDirect = true)
{
  call(SCI_CLEARREGISTEREDIMAGES, 0, 0, bDirect);
}

int autoCGetTypeSeparator(bool bDirect = true)
{
  return call(SCI_AUTOCGETTYPESEPARATOR, 0, 0, bDirect);
}

void autoCSetTypeSeparator(int separatorCharacter, bool bDirect = true)
{
  call(SCI_AUTOCSETTYPESEPARATOR, separatorCharacter, 0, bDirect);
}

void autoCSetMaxWidth(int characterCount, bool bDirect = true)
{
  call(SCI_AUTOCSETMAXWIDTH, characterCount, 0, bDirect);
}

int autoCGetMaxWidth(bool bDirect = true)
{
  return call(SCI_AUTOCGETMAXWIDTH, 0, 0, bDirect);
}

void autoCSetMaxHeight(int rowCount, bool bDirect = true)
{
  call(SCI_AUTOCSETMAXHEIGHT, rowCount, 0, bDirect);
}

int autoCGetMaxHeight(bool bDirect = true)
{
  return call(SCI_AUTOCGETMAXHEIGHT, 0, 0, bDirect);
}

void setIndent(int indentSize, bool bDirect = true)
{
  call(SCI_SETINDENT, indentSize, 0, bDirect);
}

int getIndent(bool bDirect = true)
{
  return call(SCI_GETINDENT, 0, 0, bDirect);
}

void setUseTabs(BOOL useTabs, bool bDirect = true)
{
  call(SCI_SETUSETABS, useTabs, 0, bDirect);
}

BOOL getUseTabs(bool bDirect = true)
{
  return call(SCI_GETUSETABS, 0, 0, bDirect);
}

void setLineIndentation(int line, int indentSize, bool bDirect = true)
{
  call(SCI_SETLINEINDENTATION, line, indentSize, bDirect);
}

int getLineIndentation(int line, bool bDirect = true)
{
  return call(SCI_GETLINEINDENTATION, line, 0, bDirect);
}

uint getLineIndentPosition(int line, bool bDirect = true)
{
  return call(SCI_GETLINEINDENTPOSITION, line, 0, bDirect);
}

int getColumn(uint pos, bool bDirect = true)
{
  return call(SCI_GETCOLUMN, pos, 0, bDirect);
}

void setHScrollBar(BOOL show, bool bDirect = true)
{
  call(SCI_SETHSCROLLBAR, show, 0, bDirect);
}

BOOL getHScrollBar(bool bDirect = true)
{
  return call(SCI_GETHSCROLLBAR, 0, 0, bDirect);
}

void setIndentationGuides(BOOL show, bool bDirect = true)
{
  call(SCI_SETINDENTATIONGUIDES, show, 0, bDirect);
}

BOOL getIndentationGuides(bool bDirect = true)
{
  return call(SCI_GETINDENTATIONGUIDES, 0, 0, bDirect);
}

void setHighlightGuide(int column, bool bDirect = true)
{
  call(SCI_SETHIGHLIGHTGUIDE, column, 0, bDirect);
}

int getHighlightGuide(bool bDirect = true)
{
  return call(SCI_GETHIGHLIGHTGUIDE, 0, 0, bDirect);
}

int getLineEndPosition(int line, bool bDirect = true)
{
  return call(SCI_GETLINEENDPOSITION, line, 0, bDirect);
}

int getCodePage(bool bDirect = true)
{
  return call(SCI_GETCODEPAGE, 0, 0, bDirect);
}

int getCaretFore(bool bDirect = true)
{
  return call(SCI_GETCARETFORE, 0, 0, bDirect);
}

BOOL getUsePalette(bool bDirect = true)
{
  return call(SCI_GETUSEPALETTE, 0, 0, bDirect);
}

BOOL getReadOnly(bool bDirect = true)
{
  return call(SCI_GETREADONLY, 0, 0, bDirect);
}

void setCurrentPos(uint pos, bool bDirect = true)
{
  call(SCI_SETCURRENTPOS, pos, 0, bDirect);
}

void setSelectionStart(uint pos, bool bDirect = true)
{
  call(SCI_SETSELECTIONSTART, pos, 0, bDirect);
}

uint getSelectionStart(bool bDirect = true)
{
  return call(SCI_GETSELECTIONSTART, 0, 0, bDirect);
}

void setSelectionEnd(uint pos, bool bDirect = true)
{
  call(SCI_SETSELECTIONEND, pos, 0, bDirect);
}

uint getSelectionEnd(bool bDirect = true)
{
  return call(SCI_GETSELECTIONEND, 0, 0, bDirect);
}

void setPrintMagnification(int magnification, bool bDirect = true)
{
  call(SCI_SETPRINTMAGNIFICATION, magnification, 0, bDirect);
}

int getPrintMagnification(bool bDirect = true)
{
  return call(SCI_GETPRINTMAGNIFICATION, 0, 0, bDirect);
}

void setPrintColourMode(int mode, bool bDirect = true)
{
  call(SCI_SETPRINTCOLOURMODE, mode, 0, bDirect);
}

int getPrintColourMode(bool bDirect = true)
{
  return call(SCI_GETPRINTCOLOURMODE, 0, 0, bDirect);
}

uint findText(int flags, TextToFind* ft, bool bDirect = true)
{
  return call(SCI_FINDTEXT, flags, ft, bDirect);
}

// This structure is used in printing and requires some of the graphics types
// from Platform.h.  Not needed by most client code.
//uint formatRange(BOOL draw, RangeToFormat* fr, bool bDirect = true)
//{
//	return call(SCI_FORMATRANGE, draw, fr, bDirect);
//}

int getFirstVisibleLine(bool bDirect = true)
{
  return call(SCI_GETFIRSTVISIBLELINE, 0, 0, bDirect);
}

/**
 * http://scintilla.sourceforge.net/ScintillaDoc.html#SCI_GETLINE
 * SCI_GETLINE(int line, char *text) This fills the buffer defined by text with
 * the contents of the nominated line (lines start at 0). The buffer is not
 * terminated by a 0 character. It is up to you to make sure that the buffer is
 * long enough for the text, use SCI_LINELENGTH(int line). The returned value is
 * the number of characters copied to the buffer. The returned text includes any
 * end of line characters. If you ask for a line number outside the range of
 * lines in the document, 0 characters are copied. If the text argument is 0
 * then the length that should be allocated to store the entire line is
 * returned.

 * See also: SCI_GETCURLINE, SCI_GETSELTEXT, SCI_GETTEXTRANGE,
 * SCI_GETSTYLEDTEXT, SCI_GETTEXT
 */
/**
 * <Shawn> No end of line characters included
 */ 
char[] getLine(int line, bool bDirect = true)
{
	// really length (no CR LF included)
	int len = getLineEndPosition(line) - positionFromLine(line);
	// full length with( CR/LF)
	int lineLength = sendMessage(SCI_GETLINE, line, 0);
	char[] text = new char[lineLength];
  	call(SCI_GETLINE, line, cast(int)cast(char*)text, bDirect);
	return text[0..len];
}

int getLineCount(bool bDirect = true)
{
  return call(SCI_GETLINECOUNT, 0, 0, bDirect);
}

void setMarginLeft(int pixelWidth, bool bDirect = true)
{
  call(SCI_SETMARGINLEFT, 0, pixelWidth, bDirect);
}

int getMarginLeft(bool bDirect = true)
{
  return call(SCI_GETMARGINLEFT, 0, 0, bDirect);
}

void setMarginRight(int pixelWidth, bool bDirect = true)
{
  call(SCI_SETMARGINRIGHT, 0, pixelWidth, bDirect);
}

int getMarginRight(bool bDirect = true)
{
  return call(SCI_GETMARGINRIGHT, 0, 0, bDirect);
}

BOOL getModify(bool bDirect = true)
{
  return call(SCI_GETMODIFY, 0, 0, bDirect);
}

void setSel(uint start, uint end, bool bDirect = true)
{
  call(SCI_SETSEL, start, end, bDirect);
}

int getTextRange(TextRange* tr, bool bDirect = true)
{
  return call(SCI_GETTEXTRANGE, 0, tr, bDirect);
}

void hideSelection(BOOL normal, bool bDirect = true)
{
  call(SCI_HIDESELECTION, normal, 0, bDirect);
}

int pointXFromPosition(uint pos, bool bDirect = true)
{
  return call(SCI_POINTXFROMPOSITION, 0, pos, bDirect);
}

int pointYFromPosition(uint pos, bool bDirect = true)
{
  return call(SCI_POINTYFROMPOSITION, 0, pos, bDirect);
}

int lineFromPosition(uint pos, bool bDirect = true)
{
  return call(SCI_LINEFROMPOSITION, pos, 0, bDirect);
}

uint positionFromLine(int line, bool bDirect = true)
{
  return call(SCI_POSITIONFROMLINE, line, 0, bDirect);
}

void lineScroll(int columns, int lines, bool bDirect = true)
{
  call(SCI_LINESCROLL, columns, lines, bDirect);
}

void scrollCaret(bool bDirect = true)
{
  call(SCI_SCROLLCARET, 0, 0, bDirect);
}

void replaceSel(char[] text, bool bDirect = true)
{
  call(SCI_REPLACESEL, 0, text, bDirect);
}

void setReadOnly(BOOL readOnly, bool bDirect = true)
{
  call(SCI_SETREADONLY, readOnly, 0, bDirect);
}

void sciNull(bool bDirect = true)
{
  call(SCI_NULL, 0, 0, bDirect);
}

BOOL canPaste(bool bDirect = true)
{
  return call(SCI_CANPASTE, 0, 0, bDirect);
}

BOOL canUndo(bool bDirect = true)
{
  return call(SCI_CANUNDO, 0, 0, bDirect);
}

void emptyUndoBuffer(bool bDirect = true)
{
  call(SCI_EMPTYUNDOBUFFER, 0, 0, bDirect);
}

void undo(bool bDirect = true)
{
  call(SCI_UNDO, 0, 0, bDirect);
}

void cut(bool bDirect = true)
{
  call(SCI_CUT, 0, 0, bDirect);
}

void copy(bool bDirect = true)
{
  call(SCI_COPY, 0, 0, bDirect);
}

void paste(bool bDirect = true)
{
  call(SCI_PASTE, 0, 0, bDirect);
}

void clear(bool bDirect = true)
{
  call(SCI_CLEAR, 0, 0, bDirect);
}

void setText(char[] text, bool bDirect = true)
{
  call(SCI_SETTEXT, 0, text, bDirect);
}


/**
 * http://scintilla.sourceforge.net/ScintillaDoc.html#SCI_GETTEXT
 * SCI_GETTEXT(int length, char *text) This returns length- 1 characters of text
 * from the start of the document plus one terminating 0 character. To collect
 * all the text in a document, use SCI_GETLENGTH to get the number of characters
 * in the document (nLen), allocate a character buffer of length nLen+1 bytes,
 * then call SCI_GETTEXT (nLen+1, char *text). If the text argument is 0 then
 * the length that should be allocated to store the entire document is returned.
 * If you then save the text, you should use SCI_SETSAVEPOINT to mark the text
 * as unmodified.
 */
char[] getText(bool bDirect = true)
{
	int documentLength = getTextLength(bDirect);
	char[] text = new char[documentLength + 1];
	call(SCI_GETTEXT, documentLength + 1, cast(int)cast(char*)text, bDirect);
	
	return text[0..documentLength];
}

int getTextLength(bool bDirect = true)
{
  return call(SCI_GETTEXTLENGTH, 0, 0, bDirect);
}

void setOvertype(BOOL overtype, bool bDirect = true)
{
  call(SCI_SETOVERTYPE, overtype, 0, bDirect);
}

BOOL getOvertype(bool bDirect = true)
{
  return call(SCI_GETOVERTYPE, 0, 0, bDirect);
}

void setCaretWidth(int pixelWidth, bool bDirect = true)
{
  call(SCI_SETCARETWIDTH, pixelWidth, 0, bDirect);
}

int getCaretWidth(bool bDirect = true)
{
  return call(SCI_GETCARETWIDTH, 0, 0, bDirect);
}

void setTargetStart(uint pos, bool bDirect = true)
{
  call(SCI_SETTARGETSTART, pos, 0, bDirect);
}

uint getTargetStart(bool bDirect = true)
{
  return call(SCI_GETTARGETSTART, 0, 0, bDirect);
}

void setTargetEnd(uint pos, bool bDirect = true)
{
  call(SCI_SETTARGETEND, pos, 0, bDirect);
}

uint getTargetEnd(bool bDirect = true)
{
  return call(SCI_GETTARGETEND, 0, 0, bDirect);
}

int replaceTarget(char[] text, bool bDirect = true)
{
  return call(SCI_REPLACETARGET, text.length, text, bDirect);
}

int replaceTargetRE(char[] text, bool bDirect = true)
{
  return call(SCI_REPLACETARGETRE, text.length, text, bDirect);
}

int searchInTarget(char[] text, bool bDirect = true)
{
  return call(SCI_SEARCHINTARGET, text.length, text, bDirect);
}

void setSearchFlags(int flags, bool bDirect = true)
{
  call(SCI_SETSEARCHFLAGS, flags, 0, bDirect);
}

int getSearchFlags(bool bDirect = true)
{
  return call(SCI_GETSEARCHFLAGS, 0, 0, bDirect);
}

void callTipShow(uint pos, char[] definition, bool bDirect = true)
{
  call(SCI_CALLTIPSHOW, pos, definition, bDirect);
}

void callTipCancel(bool bDirect = true)
{
  call(SCI_CALLTIPCANCEL, 0, 0, bDirect);
}

BOOL callTipActive(bool bDirect = true)
{
  return call(SCI_CALLTIPACTIVE, 0, 0, bDirect);
}

uint callTipPosStart(bool bDirect = true)
{
  return call(SCI_CALLTIPPOSSTART, 0, 0, bDirect);
}

void callTipSetHlt(int start, int end, bool bDirect = true)
{
  call(SCI_CALLTIPSETHLT, start, end, bDirect);
}

void callTipSetBack(int back, bool bDirect = true)
{
  call(SCI_CALLTIPSETBACK, back, 0, bDirect);
}

void callTipSetFore(int fore, bool bDirect = true)
{
  call(SCI_CALLTIPSETFORE, fore, 0, bDirect);
}

void callTipSetForeHlt(int fore, bool bDirect = true)
{
  call(SCI_CALLTIPSETFOREHLT, fore, 0, bDirect);
}

int visibleFromDocLine(int line, bool bDirect = true)
{
  return call(SCI_VISIBLEFROMDOCLINE, line, 0, bDirect);
}

int docLineFromVisible(int lineDisplay, bool bDirect = true)
{
  return call(SCI_DOCLINEFROMVISIBLE, lineDisplay, 0, bDirect);
}

int wrapCount(int line, bool bDirect = true)
{
  return call(SCI_WRAPCOUNT, line, 0, bDirect);
}

void setFoldLevel(int line, int level, bool bDirect = true)
{
  call(SCI_SETFOLDLEVEL, line, level, bDirect);
}

int getFoldLevel(int line, bool bDirect = true)
{
  return call(SCI_GETFOLDLEVEL, line, 0, bDirect);
}

int getLastChild(int line, int level, bool bDirect = true)
{
  return call(SCI_GETLASTCHILD, line, level, bDirect);
}

int getFoldParent(int line, bool bDirect = true)
{
  return call(SCI_GETFOLDPARENT, line, 0, bDirect);
}

void showLines(int lineStart, int lineEnd, bool bDirect = true)
{
  call(SCI_SHOWLINES, lineStart, lineEnd, bDirect);
}

void hideLines(int lineStart, int lineEnd, bool bDirect = true)
{
  call(SCI_HIDELINES, lineStart, lineEnd, bDirect);
}

BOOL getLineVisible(int line, bool bDirect = true)
{
  return call(SCI_GETLINEVISIBLE, line, 0, bDirect);
}

void setFoldExpanded(int line, BOOL expanded, bool bDirect = true)
{
  call(SCI_SETFOLDEXPANDED, line, expanded, bDirect);
}

BOOL getFoldExpanded(int line, bool bDirect = true)
{
  return call(SCI_GETFOLDEXPANDED, line, 0, bDirect);
}

void toggleFold(int line, bool bDirect = true)
{
  call(SCI_TOGGLEFOLD, line, 0, bDirect);
}

void ensureVisible(int line, bool bDirect = true)
{
  call(SCI_ENSUREVISIBLE, line, 0, bDirect);
}

void setFoldFlags(int flags, bool bDirect = true)
{
  call(SCI_SETFOLDFLAGS, flags, 0, bDirect);
}

void ensureVisibleEnforcePolicy(int line, bool bDirect = true)
{
  call(SCI_ENSUREVISIBLEENFORCEPOLICY, line, 0, bDirect);
}

void setTabIndents(BOOL tabIndents, bool bDirect = true)
{
  call(SCI_SETTABINDENTS, tabIndents, 0, bDirect);
}

BOOL getTabIndents(bool bDirect = true)
{
  return call(SCI_GETTABINDENTS, 0, 0, bDirect);
}

void setBackSpaceUnIndents(BOOL bsUnIndents, bool bDirect = true)
{
  call(SCI_SETBACKSPACEUNINDENTS, bsUnIndents, 0, bDirect);
}

BOOL getBackSpaceUnIndents(bool bDirect = true)
{
  return call(SCI_GETBACKSPACEUNINDENTS, 0, 0, bDirect);
}

void setMouseDwellTime(int periodMilliseconds, bool bDirect = true)
{
  call(SCI_SETMOUSEDWELLTIME, periodMilliseconds, 0, bDirect);
}

int getMouseDwellTime(bool bDirect = true)
{
  return call(SCI_GETMOUSEDWELLTIME, 0, 0, bDirect);
}

int wordStartPosition(uint pos, BOOL onlyWordCharacters, bool bDirect = true)
{
  return call(SCI_WORDSTARTPOSITION, pos, onlyWordCharacters, bDirect);
}

int wordEndPosition(uint pos, BOOL onlyWordCharacters, bool bDirect = true)
{
  return call(SCI_WORDENDPOSITION, pos, onlyWordCharacters, bDirect);
}

void setWrapMode(int mode, bool bDirect = true)
{
  call(SCI_SETWRAPMODE, mode, 0, bDirect);
}

int getWrapMode(bool bDirect = true)
{
  return call(SCI_GETWRAPMODE, 0, 0, bDirect);
}

void setWrapVisualFlags(int wrapVisualFlags, bool bDirect = true)
{
  call(SCI_SETWRAPVISUALFLAGS, wrapVisualFlags, 0, bDirect);
}

int getWrapVisualFlags(bool bDirect = true)
{
  return call(SCI_GETWRAPVISUALFLAGS, 0, 0, bDirect);
}

void setWrapVisualFlagsLocation(int wrapVisualFlagsLocation, bool bDirect = true)
{
  call(SCI_SETWRAPVISUALFLAGSLOCATION, wrapVisualFlagsLocation, 0, bDirect);
}

int getWrapVisualFlagsLocation(bool bDirect = true)
{
  return call(SCI_GETWRAPVISUALFLAGSLOCATION, 0, 0, bDirect);
}

void setWrapStartIndent(int indent, bool bDirect = true)
{
  call(SCI_SETWRAPSTARTINDENT, indent, 0, bDirect);
}

int getWrapStartIndent(bool bDirect = true)
{
  return call(SCI_GETWRAPSTARTINDENT, 0, 0, bDirect);
}

void setLayoutCache(int mode, bool bDirect = true)
{
  call(SCI_SETLAYOUTCACHE, mode, 0, bDirect);
}

int getLayoutCache(bool bDirect = true)
{
  return call(SCI_GETLAYOUTCACHE, 0, 0, bDirect);
}

void setScrollWidth(int pixelWidth, bool bDirect = true)
{
  call(SCI_SETSCROLLWIDTH, pixelWidth, 0, bDirect);
}

int getScrollWidth(bool bDirect = true)
{
  return call(SCI_GETSCROLLWIDTH, 0, 0, bDirect);
}

int textWidth(int style, char[] text, bool bDirect = true)
{
  return call(SCI_TEXTWIDTH, style, text, bDirect);
}

void setEndAtLastLine(BOOL endAtLastLine, bool bDirect = true)
{
  call(SCI_SETENDATLASTLINE, endAtLastLine, 0, bDirect);
}

BOOL getEndAtLastLine(bool bDirect = true)
{
  return call(SCI_GETENDATLASTLINE, 0, 0, bDirect);
}

int textHeight(int line, bool bDirect = true)
{
  return call(SCI_TEXTHEIGHT, line, 0, bDirect);
}

void setVScrollBar(BOOL show, bool bDirect = true)
{
  call(SCI_SETVSCROLLBAR, show, 0, bDirect);
}

BOOL getVScrollBar(bool bDirect = true)
{
  return call(SCI_GETVSCROLLBAR, 0, 0, bDirect);
}

void appendText(char[] text, bool bDirect = true)
{
  call(SCI_APPENDTEXT, text.length, text, bDirect);
}

BOOL getTwoPhaseDraw(bool bDirect = true)
{
  return call(SCI_GETTWOPHASEDRAW, 0, 0, bDirect);
}

void setTwoPhaseDraw(BOOL twoPhase, bool bDirect = true)
{
  call(SCI_SETTWOPHASEDRAW, twoPhase, 0, bDirect);
}

void targetFromSelection(bool bDirect = true)
{
  call(SCI_TARGETFROMSELECTION, 0, 0, bDirect);
}

void linesJoin(bool bDirect = true)
{
  call(SCI_LINESJOIN, 0, 0, bDirect);
}

void linesSplit(int pixelWidth, bool bDirect = true)
{
  call(SCI_LINESSPLIT, pixelWidth, 0, bDirect);
}

void setFoldMarginColour(BOOL useSetting, int back, bool bDirect = true)
{
  call(SCI_SETFOLDMARGINCOLOUR, useSetting, back, bDirect);
}

void setFoldMarginHiColour(BOOL useSetting, int fore, bool bDirect = true)
{
  call(SCI_SETFOLDMARGINHICOLOUR, useSetting, fore, bDirect);
}

void lineDown(bool bDirect = true)
{
  call(SCI_LINEDOWN, 0, 0, bDirect);
}

void lineDownExtend(bool bDirect = true)
{
  call(SCI_LINEDOWNEXTEND, 0, 0, bDirect);
}

void lineUp(bool bDirect = true)
{
  call(SCI_LINEUP, 0, 0, bDirect);
}

void lineUpExtend(bool bDirect = true)
{
  call(SCI_LINEUPEXTEND, 0, 0, bDirect);
}

void charLeft(bool bDirect = true)
{
  call(SCI_CHARLEFT, 0, 0, bDirect);
}

void charLeftExtend(bool bDirect = true)
{
  call(SCI_CHARLEFTEXTEND, 0, 0, bDirect);
}

void charRight(bool bDirect = true)
{
  call(SCI_CHARRIGHT, 0, 0, bDirect);
}

void charRightExtend(bool bDirect = true)
{
  call(SCI_CHARRIGHTEXTEND, 0, 0, bDirect);
}

void wordLeft(bool bDirect = true)
{
  call(SCI_WORDLEFT, 0, 0, bDirect);
}

void wordLeftExtend(bool bDirect = true)
{
  call(SCI_WORDLEFTEXTEND, 0, 0, bDirect);
}

void wordRight(bool bDirect = true)
{
  call(SCI_WORDRIGHT, 0, 0, bDirect);
}

void wordRightExtend(bool bDirect = true)
{
  call(SCI_WORDRIGHTEXTEND, 0, 0, bDirect);
}

void home(bool bDirect = true)
{
  call(SCI_HOME, 0, 0, bDirect);
}

void homeExtend(bool bDirect = true)
{
  call(SCI_HOMEEXTEND, 0, 0, bDirect);
}

void lineEnd(bool bDirect = true)
{
  call(SCI_LINEEND, 0, 0, bDirect);
}

void lineEndExtend(bool bDirect = true)
{
  call(SCI_LINEENDEXTEND, 0, 0, bDirect);
}

void documentStart(bool bDirect = true)
{
  call(SCI_DOCUMENTSTART, 0, 0, bDirect);
}

void documentStartExtend(bool bDirect = true)
{
  call(SCI_DOCUMENTSTARTEXTEND, 0, 0, bDirect);
}

void documentEnd(bool bDirect = true)
{
  call(SCI_DOCUMENTEND, 0, 0, bDirect);
}

void documentEndExtend(bool bDirect = true)
{
  call(SCI_DOCUMENTENDEXTEND, 0, 0, bDirect);
}

void pageUp(bool bDirect = true)
{
  call(SCI_PAGEUP, 0, 0, bDirect);
}

void pageUpExtend(bool bDirect = true)
{
  call(SCI_PAGEUPEXTEND, 0, 0, bDirect);
}

void pageDown(bool bDirect = true)
{
  call(SCI_PAGEDOWN, 0, 0, bDirect);
}

void pageDownExtend(bool bDirect = true)
{
  call(SCI_PAGEDOWNEXTEND, 0, 0, bDirect);
}

void editToggleOvertype(bool bDirect = true)
{
  call(SCI_EDITTOGGLEOVERTYPE, 0, 0, bDirect);
}

void cancel(bool bDirect = true)
{
  call(SCI_CANCEL, 0, 0, bDirect);
}

void deleteBack(bool bDirect = true)
{
  call(SCI_DELETEBACK, 0, 0, bDirect);
}

void tab(bool bDirect = true)
{
  call(SCI_TAB, 0, 0, bDirect);
}

void backTab(bool bDirect = true)
{
  call(SCI_BACKTAB, 0, 0, bDirect);
}

void newLine(bool bDirect = true)
{
  call(SCI_NEWLINE, 0, 0, bDirect);
}

void formFeed(bool bDirect = true)
{
  call(SCI_FORMFEED, 0, 0, bDirect);
}

void vCHome(bool bDirect = true)
{
  call(SCI_VCHOME, 0, 0, bDirect);
}

void vCHomeExtend(bool bDirect = true)
{
  call(SCI_VCHOMEEXTEND, 0, 0, bDirect);
}

void zoomIn(bool bDirect = true)
{
  call(SCI_ZOOMIN, 0, 0, bDirect);
}

void zoomOut(bool bDirect = true)
{
  call(SCI_ZOOMOUT, 0, 0, bDirect);
}

void delWordLeft(bool bDirect = true)
{
  call(SCI_DELWORDLEFT, 0, 0, bDirect);
}

void delWordRight(bool bDirect = true)
{
  call(SCI_DELWORDRIGHT, 0, 0, bDirect);
}

void lineCut(bool bDirect = true)
{
  call(SCI_LINECUT, 0, 0, bDirect);
}

void lineDelete(bool bDirect = true)
{
  call(SCI_LINEDELETE, 0, 0, bDirect);
}

void lineTranspose(bool bDirect = true)
{
  call(SCI_LINETRANSPOSE, 0, 0, bDirect);
}

void lineDuplicate(bool bDirect = true)
{
  call(SCI_LINEDUPLICATE, 0, 0, bDirect);
}

void lowerCase(bool bDirect = true)
{
  call(SCI_LOWERCASE, 0, 0, bDirect);
}

void upperCase(bool bDirect = true)
{
  call(SCI_UPPERCASE, 0, 0, bDirect);
}

void lineScrollDown(bool bDirect = true)
{
  call(SCI_LINESCROLLDOWN, 0, 0, bDirect);
}

void lineScrollUp(bool bDirect = true)
{
  call(SCI_LINESCROLLUP, 0, 0, bDirect);
}

void deleteBackNotLine(bool bDirect = true)
{
  call(SCI_DELETEBACKNOTLINE, 0, 0, bDirect);
}

void homeDisplay(bool bDirect = true)
{
  call(SCI_HOMEDISPLAY, 0, 0, bDirect);
}

void homeDisplayExtend(bool bDirect = true)
{
  call(SCI_HOMEDISPLAYEXTEND, 0, 0, bDirect);
}

void lineEndDisplay(bool bDirect = true)
{
  call(SCI_LINEENDDISPLAY, 0, 0, bDirect);
}

void lineEndDisplayExtend(bool bDirect = true)
{
  call(SCI_LINEENDDISPLAYEXTEND, 0, 0, bDirect);
}

void homeWrap(bool bDirect = true)
{
  call(SCI_HOMEWRAP, 0, 0, bDirect);
}

void homeWrapExtend(bool bDirect = true)
{
  call(SCI_HOMEWRAPEXTEND, 0, 0, bDirect);
}

void lineEndWrap(bool bDirect = true)
{
  call(SCI_LINEENDWRAP, 0, 0, bDirect);
}

void lineEndWrapExtend(bool bDirect = true)
{
  call(SCI_LINEENDWRAPEXTEND, 0, 0, bDirect);
}

void vCHomeWrap(bool bDirect = true)
{
  call(SCI_VCHOMEWRAP, 0, 0, bDirect);
}

void vCHomeWrapExtend(bool bDirect = true)
{
  call(SCI_VCHOMEWRAPEXTEND, 0, 0, bDirect);
}

void lineCopy(bool bDirect = true)
{
  call(SCI_LINECOPY, 0, 0, bDirect);
}

void moveCaretInsideView(bool bDirect = true)
{
  call(SCI_MOVECARETINSIDEVIEW, 0, 0, bDirect);
}

int lineLength(int line, bool bDirect = true)
{
  return call(SCI_LINELENGTH, line, 0, bDirect);
}

void braceHighlight(uint pos1, uint pos2, bool bDirect = true)
{
  call(SCI_BRACEHIGHLIGHT, pos1, pos2, bDirect);
}

void braceBadLight(uint pos, bool bDirect = true)
{
  call(SCI_BRACEBADLIGHT, pos, 0, bDirect);
}

uint braceMatch(uint pos, bool bDirect = true)
{
  return call(SCI_BRACEMATCH, pos, 0, bDirect);
}

BOOL getViewEOL(bool bDirect = true)
{
  return call(SCI_GETVIEWEOL, 0, 0, bDirect);
}

void setViewEOL(BOOL visible, bool bDirect = true)
{
  call(SCI_SETVIEWEOL, visible, 0, bDirect);
}

int getDocPointer(bool bDirect = true)
{
  return call(SCI_GETDOCPOINTER, 0, 0, bDirect);
}

void setDocPointer(int pointer, bool bDirect = true)
{
  call(SCI_SETDOCPOINTER, 0, pointer, bDirect);
}

void setModEventMask(int mask, bool bDirect = true)
{
  call(SCI_SETMODEVENTMASK, mask, 0, bDirect);
}

int getEdgeColumn(bool bDirect = true)
{
  return call(SCI_GETEDGECOLUMN, 0, 0, bDirect);
}

void setEdgeColumn(int column, bool bDirect = true)
{
  call(SCI_SETEDGECOLUMN, column, 0, bDirect);
}

int getEdgeMode(bool bDirect = true)
{
  return call(SCI_GETEDGEMODE, 0, 0, bDirect);
}

void setEdgeMode(int mode, bool bDirect = true)
{
  call(SCI_SETEDGEMODE, mode, 0, bDirect);
}

int getEdgeColour(bool bDirect = true)
{
  return call(SCI_GETEDGECOLOUR, 0, 0, bDirect);
}

void setEdgeColour(int edgeColour, bool bDirect = true)
{
  call(SCI_SETEDGECOLOUR, edgeColour, 0, bDirect);
}

void searchAnchor(bool bDirect = true)
{
  call(SCI_SEARCHANCHOR, 0, 0, bDirect);
}

int searchNext(int flags, char[] text, bool bDirect = true)
{
  return call(SCI_SEARCHNEXT, flags, text, bDirect);
}

int searchPrev(int flags, char[] text, bool bDirect = true)
{
  return call(SCI_SEARCHPREV, flags, text, bDirect);
}

int linesOnScreen(bool bDirect = true)
{
  return call(SCI_LINESONSCREEN, 0, 0, bDirect);
}

void usePopUp(BOOL allowPopUp, bool bDirect = true)
{
  call(SCI_USEPOPUP, allowPopUp, 0, bDirect);
}

BOOL selectionIsRectangle(bool bDirect = true)
{
  return call(SCI_SELECTIONISRECTANGLE, 0, 0, bDirect);
}

void setZoom(int zoom, bool bDirect = true)
{
  call(SCI_SETZOOM, zoom, 0, bDirect);
}

int getZoom(bool bDirect = true)
{
  return call(SCI_GETZOOM, 0, 0, bDirect);
}

int createDocument(bool bDirect = true)
{
  return call(SCI_CREATEDOCUMENT, 0, 0, bDirect);
}

void addRefDocument(int doc, bool bDirect = true)
{
  call(SCI_ADDREFDOCUMENT, 0, doc, bDirect);
}

void releaseDocument(int doc, bool bDirect = true)
{
  call(SCI_RELEASEDOCUMENT, 0, doc, bDirect);
}

int getModEventMask(bool bDirect = true)
{
  return call(SCI_GETMODEVENTMASK, 0, 0, bDirect);
}

void setFocus(BOOL focus, bool bDirect = true)
{
  call(SCI_SETFOCUS, focus, 0, bDirect);
}

BOOL getFocus(bool bDirect = true)
{
  return call(SCI_GETFOCUS, 0, 0, bDirect);
}

void setStatus(int statusCode, bool bDirect = true)
{
  call(SCI_SETSTATUS, statusCode, 0, bDirect);
}

int getStatus(bool bDirect = true)
{
  return call(SCI_GETSTATUS, 0, 0, bDirect);
}

void setMouseDownCaptures(BOOL captures, bool bDirect = true)
{
  call(SCI_SETMOUSEDOWNCAPTURES, captures, 0, bDirect);
}

BOOL getMouseDownCaptures(bool bDirect = true)
{
  return call(SCI_GETMOUSEDOWNCAPTURES, 0, 0, bDirect);
}

void setCursor(int cursorType, bool bDirect = true)
{
  call(SCI_SETCURSOR, cursorType, 0, bDirect);
}

int getCursor(bool bDirect = true)
{
  return call(SCI_GETCURSOR, 0, 0, bDirect);
}

void setControlCharSymbol(int symbol, bool bDirect = true)
{
  call(SCI_SETCONTROLCHARSYMBOL, symbol, 0, bDirect);
}

int getControlCharSymbol(bool bDirect = true)
{
  return call(SCI_GETCONTROLCHARSYMBOL, 0, 0, bDirect);
}

void wordPartLeft(bool bDirect = true)
{
  call(SCI_WORDPARTLEFT, 0, 0, bDirect);
}

void wordPartLeftExtend(bool bDirect = true)
{
  call(SCI_WORDPARTLEFTEXTEND, 0, 0, bDirect);
}

void wordPartRight(bool bDirect = true)
{
  call(SCI_WORDPARTRIGHT, 0, 0, bDirect);
}

void wordPartRightExtend(bool bDirect = true)
{
  call(SCI_WORDPARTRIGHTEXTEND, 0, 0, bDirect);
}

void setVisiblePolicy(int visiblePolicy, int visibleSlop, bool bDirect = true)
{
  call(SCI_SETVISIBLEPOLICY, visiblePolicy, visibleSlop, bDirect);
}

void delLineLeft(bool bDirect = true)
{
  call(SCI_DELLINELEFT, 0, 0, bDirect);
}

void delLineRight(bool bDirect = true)
{
  call(SCI_DELLINERIGHT, 0, 0, bDirect);
}

void setXOffset(int newOffset, bool bDirect = true)
{
  call(SCI_SETXOFFSET, newOffset, 0, bDirect);
}

int getXOffset(bool bDirect = true)
{
  return call(SCI_GETXOFFSET, 0, 0, bDirect);
}

void chooseCaretX(bool bDirect = true)
{
  call(SCI_CHOOSECARETX, 0, 0, bDirect);
}

void grabFocus(bool bDirect = true)
{
  call(SCI_GRABFOCUS, 0, 0, bDirect);
}

void setXCaretPolicy(int caretPolicy, int caretSlop, bool bDirect = true)
{
  call(SCI_SETXCARETPOLICY, caretPolicy, caretSlop, bDirect);
}

void setYCaretPolicy(int caretPolicy, int caretSlop, bool bDirect = true)
{
  call(SCI_SETYCARETPOLICY, caretPolicy, caretSlop, bDirect);
}

void setPrintWrapMode(int mode, bool bDirect = true)
{
  call(SCI_SETPRINTWRAPMODE, mode, 0, bDirect);
}

int getPrintWrapMode(bool bDirect = true)
{
  return call(SCI_GETPRINTWRAPMODE, 0, 0, bDirect);
}

void setHotspotActiveFore(BOOL useSetting, int fore, bool bDirect = true)
{
  call(SCI_SETHOTSPOTACTIVEFORE, useSetting, fore, bDirect);
}

void setHotspotActiveBack(BOOL useSetting, int back, bool bDirect = true)
{
  call(SCI_SETHOTSPOTACTIVEBACK, useSetting, back, bDirect);
}

void setHotspotActiveUnderline(BOOL underline, bool bDirect = true)
{
  call(SCI_SETHOTSPOTACTIVEUNDERLINE, underline, 0, bDirect);
}

void setHotspotSingleLine(BOOL singleLine, bool bDirect = true)
{
  call(SCI_SETHOTSPOTSINGLELINE, singleLine, 0, bDirect);
}

void paraDown(bool bDirect = true)
{
  call(SCI_PARADOWN, 0, 0, bDirect);
}

void paraDownExtend(bool bDirect = true)
{
  call(SCI_PARADOWNEXTEND, 0, 0, bDirect);
}

void paraUp(bool bDirect = true)
{
  call(SCI_PARAUP, 0, 0, bDirect);
}

void paraUpExtend(bool bDirect = true)
{
  call(SCI_PARAUPEXTEND, 0, 0, bDirect);
}

uint positionBefore(uint pos, bool bDirect = true)
{
  return call(SCI_POSITIONBEFORE, pos, 0, bDirect);
}

uint positionAfter(uint pos, bool bDirect = true)
{
  return call(SCI_POSITIONAFTER, pos, 0, bDirect);
}

void copyRange(uint start, uint end, bool bDirect = true)
{
  call(SCI_COPYRANGE, start, end, bDirect);
}

void copyText(char[] text, bool bDirect = true)
{
  call(SCI_COPYTEXT, text.length, text, bDirect);
}

void setSelectionMode(int mode, bool bDirect = true)
{
  call(SCI_SETSELECTIONMODE, mode, 0, bDirect);
}

int getSelectionMode(bool bDirect = true)
{
  return call(SCI_GETSELECTIONMODE, 0, 0, bDirect);
}

uint getLineSelStartPosition(int line, bool bDirect = true)
{
  return call(SCI_GETLINESELSTARTPOSITION, line, 0, bDirect);
}

uint getLineSelEndPosition(int line, bool bDirect = true)
{
  return call(SCI_GETLINESELENDPOSITION, line, 0, bDirect);
}

void lineDownRectExtend(bool bDirect = true)
{
  call(SCI_LINEDOWNRECTEXTEND, 0, 0, bDirect);
}

void lineUpRectExtend(bool bDirect = true)
{
  call(SCI_LINEUPRECTEXTEND, 0, 0, bDirect);
}

void charLeftRectExtend(bool bDirect = true)
{
  call(SCI_CHARLEFTRECTEXTEND, 0, 0, bDirect);
}

void charRightRectExtend(bool bDirect = true)
{
  call(SCI_CHARRIGHTRECTEXTEND, 0, 0, bDirect);
}

void homeRectExtend(bool bDirect = true)
{
  call(SCI_HOMERECTEXTEND, 0, 0, bDirect);
}

void vCHomeRectExtend(bool bDirect = true)
{
  call(SCI_VCHOMERECTEXTEND, 0, 0, bDirect);
}

void lineEndRectExtend(bool bDirect = true)
{
  call(SCI_LINEENDRECTEXTEND, 0, 0, bDirect);
}

void pageUpRectExtend(bool bDirect = true)
{
  call(SCI_PAGEUPRECTEXTEND, 0, 0, bDirect);
}

void pageDownRectExtend(bool bDirect = true)
{
  call(SCI_PAGEDOWNRECTEXTEND, 0, 0, bDirect);
}

void stutteredPageUp(bool bDirect = true)
{
  call(SCI_STUTTEREDPAGEUP, 0, 0, bDirect);
}

void stutteredPageUpExtend(bool bDirect = true)
{
  call(SCI_STUTTEREDPAGEUPEXTEND, 0, 0, bDirect);
}

void stutteredPageDown(bool bDirect = true)
{
  call(SCI_STUTTEREDPAGEDOWN, 0, 0, bDirect);
}

void stutteredPageDownExtend(bool bDirect = true)
{
  call(SCI_STUTTEREDPAGEDOWNEXTEND, 0, 0, bDirect);
}

void wordLeftEnd(bool bDirect = true)
{
  call(SCI_WORDLEFTEND, 0, 0, bDirect);
}

void wordLeftEndExtend(bool bDirect = true)
{
  call(SCI_WORDLEFTENDEXTEND, 0, 0, bDirect);
}

void wordRightEnd(bool bDirect = true)
{
  call(SCI_WORDRIGHTEND, 0, 0, bDirect);
}

void wordRightEndExtend(bool bDirect = true)
{
  call(SCI_WORDRIGHTENDEXTEND, 0, 0, bDirect);
}

void setWhitespaceChars(char[] characters, bool bDirect = true)
{
  call(SCI_SETWHITESPACECHARS, 0, characters, bDirect);
}

void setCharsDefault(bool bDirect = true)
{
  call(SCI_SETCHARSDEFAULT, 0, 0, bDirect);
}

int autoCGetCurrent(bool bDirect = true)
{
  return call(SCI_AUTOCGETCURRENT, 0, 0, bDirect);
}

void allocate(int bytes, bool bDirect = true)
{
  call(SCI_ALLOCATE, bytes, 0, bDirect);
}

// TODO:
int targetAsUTF8(char* s, bool bDirect = true)
{
  return call(SCI_TARGETASUTF8, 0, cast(int)s, bDirect);
}

void setLengthForEncode(int bytes, bool bDirect = true)
{
  call(SCI_SETLENGTHFORENCODE, bytes, 0, bDirect);
}

// TODO:
int encodedFromUTF8(char[] utf8, char* encoded, bool bDirect = true)
{
  return call(SCI_ENCODEDFROMUTF8, cast(int)cast(char*)utf8, cast(int)encoded, bDirect);
}

int findColumn(int line, int column, bool bDirect = true)
{
  return call(SCI_FINDCOLUMN, line, column, bDirect);
}

BOOL getCaretSticky(bool bDirect = true)
{
  return call(SCI_GETCARETSTICKY, 0, 0, bDirect);
}

void setCaretSticky(BOOL useCaretStickyBehaviour, bool bDirect = true)
{
  call(SCI_SETCARETSTICKY, useCaretStickyBehaviour, 0, bDirect);
}

void toggleCaretSticky(bool bDirect = true)
{
  call(SCI_TOGGLECARETSTICKY, 0, 0, bDirect);
}

void startRecord(bool bDirect = true)
{
  call(SCI_STARTRECORD, 0, 0, bDirect);
}

void stopRecord(bool bDirect = true)
{
  call(SCI_STOPRECORD, 0, 0, bDirect);
}

void setLexer(int lexer, bool bDirect = true)
{
  call(SCI_SETLEXER, lexer, 0, bDirect);
}

int getLexer(bool bDirect = true)
{
  return call(SCI_GETLEXER, 0, 0, bDirect);
}

void colourise(uint start, uint end, bool bDirect = true)
{
  call(SCI_COLOURISE, start, end, bDirect);
}

void setProperty(char[] key, char[] value, bool bDirect = true)
{
  call(SCI_SETPROPERTY, key, value, bDirect);
}

void setKeyWords(int keywordSet, char[] keyWords, bool bDirect = true)
{
  call(SCI_SETKEYWORDS, keywordSet, keyWords, bDirect);
}

void setLexerLanguage(char[] language, bool bDirect = true)
{
  call(SCI_SETLEXERLANGUAGE, 0, language, bDirect);
}

void loadLexerLibrary(char[] path, bool bDirect = true)
{
  call(SCI_LOADLEXERLIBRARY, 0, path, bDirect);
}

char[] getProperty(char[] key, bool bDirect = true)
{
	int len = call(SCI_GETPROPERTY, key, null, bDirect);
	char[] buf = new char[len + 1];
	call(SCI_GETPROPERTY, key, cast(int)cast(char*)buf, bDirect);
	return buf[0..len - 1]; 
}

char[] getPropertyExpanded(char[] key, bool bDirect = true)
{
	int len = call(SCI_GETPROPERTYEXPANDED, key, null, bDirect);
	char[] buf = new char[len + 1];
	call(SCI_GETPROPERTYEXPANDED, key, cast(int)cast(char*)buf, bDirect);
	return buf[0..len - 1];
}

int getPropertyInt(char[] key, bool bDirect = true)
{
	return call(SCI_GETPROPERTYINT, key, 0, bDirect);
}



}	// end of class Scintilla
	